testing/cross_backend/provided_context.ts

The vitest ProvidedContext keys the cross-backend global setups provide, and the helpers a *.cross.test.ts file reads them with.

create_cross_backend_global_setup provides one backend's handle as backend_handle; create_dual_spawn_global_setup provides two, as parity_handle_a / parity_handle_b by default. This module augments vitest's ProvidedContext with those keys, so a test file that imports inject_backend_handle (or inject_parity_handles) gets the typed inject with no augmentation of its own. A project providing other keys — a dual spawn under its own provide_keys, a probe result — augments ProvidedContext for those in its own module, beside this one.

vitest refuses a value that isn't serializable, so the handles cross as SerializableBootstrappedBackendHandle; the helpers rebuild a usable handle with reconstruct_bootstrapped_handle.

view source

Declarations
#

3 declarations

inject_backend_handle
#

testing/cross_backend/provided_context.ts view source

(): ReconstructedBootstrappedBackendHandle import {inject_backend_handle} from '@fuzdev/fuz_app/testing/cross_backend/provided_context.js';

The backend the project's globalSetup spawned, rebuilt from the provided backend_handle. Call at a test file's top level.

returns

ReconstructedBootstrappedBackendHandle

inject_parity_handles
#

testing/cross_backend/provided_context.ts view source

(): InjectedParityHandles import {inject_parity_handles} from '@fuzdev/fuz_app/testing/cross_backend/provided_context.js';

The two backends a dual-spawn project provides as parity_handle_a / parity_handle_b, rebuilt. Call at a test file's top level.

returns

InjectedParityHandles

InjectedParityHandles
#

Depends on
#