Skip to main content

Function: setProcessSnapshotOverrideForTesting()

function setProcessSnapshotOverrideForTesting(snapshot: unknown): void;

Defined in: shared/utils/environment.ts:158

Testing-only setter for the process snapshot. Allows Vitest suites to simulate environments where globalThis.process is missing or has bespoke values without mutating the real Node.js global and destabilizing the test runner.

Parametersโ€‹

snapshotโ€‹

unknown

Arbitrary process-like value to expose to environment guards. Non-object values represent an unavailable process.

Returnsโ€‹

void

Remarksโ€‹

Use resetProcessSnapshotOverrideForTesting after each test to avoid leaking overrides across suites.