testRuntime
testRuntime(
config?):Runtime
Defined in: packages/runtime/src/platform/test.ts:48
Create a Runtime pre-wired for test environments.
Parameters
Section titled “Parameters”config?
Section titled “config?”Optional RuntimeConfig. capabilities overrides
the default throw-on-use stubs.
Returns
Section titled “Returns”A Runtime that boots images against the test capability bag.
Remarks
Section titled “Remarks”Zero-config: all capabilities throw except
compileWasm (Node’s native
implementation). Pass config.capabilities to selectively enable
individual capabilities for a given test. Use this when you want a full
booted instance in a test but don’t want accidental HTTP or ESM evaluation
to succeed silently.
For non-test hosts, use nodeRuntime or browserRuntime.
Example
Section titled “Example”import { Unix, stdSystem } from '@fishnet/core'import { testRuntime } from '@fishnet/runtime'
const image = await Unix().use(stdSystem()).build()await using sys = await testRuntime().boot(image)await sys.boot()