API reference
testing
Import
Section titled “Import”import * as api from "@fungi.computer/mycelium/testing";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| type alias | DirectSandboxCallback | A test callback receives the admitted bindings and cancellation. |
| function | directSandbox() | Dispatch a known-binding callback directly in this process. NOT isolation: submitted code is ignored, and the callback retains all host privileges. Use only trusted tests and examples, never model-authored code execution. |
| function | rejectingSandbox() | A test transport that always refuses execution with the supplied message. |
DirectSandboxCallbacktype alias
Section titled “DirectSandboxCallback”type DirectSandboxCallback = (bindings, signal) => Promise<SandboxValue>;A test callback receives the admitted bindings and cancellation.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
bindings |
SandboxRequest["bindings"] |
signal |
AbortSignal |
Returns
Section titled “Returns”Promise<SandboxValue>
directSandbox()function
Section titled “directSandbox()”function directSandbox(callback): Sandbox;Dispatch a known-binding callback directly in this process. NOT isolation: submitted code is ignored, and the callback retains all host privileges. Use only trusted tests and examples, never model-authored code execution.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
callback |
DirectSandboxCallback |
Returns
Section titled “Returns”rejectingSandbox()function
Section titled “rejectingSandbox()”function rejectingSandbox(message): Sandbox;A test transport that always refuses execution with the supplied message.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
message |
string |