Skip to content
API reference

testing

Import
import * as api from "@fungi.computer/mycelium/testing";
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”
Signature
type DirectSandboxCallback = (bindings, signal) => Promise<SandboxValue>;

A test callback receives the admitted bindings and cancellation.

Parameter Type
bindings SandboxRequest["bindings"]
signal AbortSignal

Promise<SandboxValue>

directSandbox()function

Section titled “directSandbox()”
Signature
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.

Parameter Type
callback DirectSandboxCallback

Sandbox


rejectingSandbox()function

Section titled “rejectingSandbox()”
Signature
function rejectingSandbox(message): Sandbox;

A test transport that always refuses execution with the supplied message.

Parameter Type
message string

Sandbox