setDefaultRuntime
Stable · since 0.1.0
Replace with a test runtime that has
Section titled “Replace with a test runtime that has mockCondition / mockAction”
Replaces the runtime returned by getDefaultRuntime. The next call to getDefaultRuntime() — and every binding hook with no provider in scope — sees the new instance.
Use this when you need a clean slate per test, when your app boot path constructs a customized runtime, or when you mount multiple isolated runtimes and want one of them to act as the default.
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Param | Type | Description |
|---|---|---|
runtime | Runtime | Any runtime created via createRuntime or createTestRuntime. |
Returns
Section titled “Returns”void. Side effect only.
Examples
Section titled “Examples”Fresh runtime per test
Section titled “Fresh runtime per test”Replace with a test runtime that has mockCondition / mockAction
Section titled “Replace with a test runtime that has mockCondition / mockAction”Custom runtime in app bootstrap
Section titled “Custom runtime in app bootstrap”Related
Section titled “Related” getDefaultRuntime Read the current singleton (and lazy-create on first call).
createRuntime Create an isolated runtime.
createTestRuntime Test-flavoured runtime with mockCondition / mockAction.
TriggerRuntimeProvider Subtree-scoped runtime injection.