Const Releases a single snapshot store's in-memory data by class name. No-op
when className is absent or no store is registered. Call between host test files to
bound memory in a long-running worker (e.g. vitest isolate: false).
Optional className: stringReleases all snapshot stores' in-memory data (clears the registry).
Whether current mode is 'record'.
Whether current mode is 'replay'.
Current operating mode. Reads the mutating SnapshotStore.mode
(tracked by setMode), so it stays consistent with Unimock.isRecord /
Unimock.isReplay after a runtime mode switch — unlike a static parse of the
UNIMOCK env var.
Resolved snapshot directory path.
Convenience namespace bundling the most common Unimock utilities.
import { Unimock } from '@biorate/unimock';
console.log(Unimock.mode); // 'off' | 'record' | 'replay'
Unimock.flush(); // flush all snapshots
Description
Flushes all dirty snapshot stores to disk.