@varianz/vitest (instructions) and wire it up once:
The re-exports above are deliberate.
@varianz/vitest exports varianzVitest, cel and the
matchers — not test or expect. Take test from varianzVitest({...}) and expect /
describe from vitest itself. The example inside the package’s own shipped fixture.d.ts JSDoc
says import { test, expect, cel } from "@varianz/vitest"; that line is wrong and does not resolve.VARIANZ_ENABLED=true, and VARIANZ_INSECURE_ALLOW_PLAINTEXT=true for a plaintext local coordinator) — the fixture throws a clear error if the SDK is disabled.
Writing tests
varianz— per-testVarianzTestSession. It installs a session-ID fallback inAsyncLocalStoragefor the whole test body, so in-process VPoint calls match your stages automatically.varianzClient— worker-scoped client for advanced coordinator assertions (most tests don’t need it).
Custom matchers
Installed by the@varianz/vitest/setup file:
Session API
Concurrency
Indescribe.concurrent / it.concurrent blocks, the module-level session fallback is last-write-wins and races under true parallelism. Re-establish the scope locally:
fileParallelism: false — the native initCoordinator binding can only initialize once per process.