Skip to content

testRuntime

testRuntime(config?): Runtime

Defined in: packages/runtime/src/platform/test.ts:48

Create a Runtime pre-wired for test environments.

RuntimeConfig

Optional RuntimeConfig. capabilities overrides the default throw-on-use stubs.

Runtime

A Runtime that boots images against the test capability bag.

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.

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()