Skip to main content
Install @varianz/vitest (instructions) and wire it up once:
Run with the standard environment (VARIANZ_ENABLED=true, and VARIANZ_INSECURE_ALLOW_PLAINTEXT=true for a plaintext local registry) — the fixture throws a clear error if the SDK is disabled.

Writing tests

Fixtures:
  • varianz — per-test VarianzTestSession. It installs a session-ID fallback in AsyncLocalStorage for the whole test body, so in-process VPoint calls match your stages automatically.
  • varianzClient — worker-scoped client for advanced registry assertions (most tests don’t need it).

Custom matchers

Installed by the @varianz/vitest/setup file:

Session API

Concurrency

In describe.concurrent / it.concurrent blocks, the module-level session fallback is last-write-wins and races under true parallelism. Re-establish the scope locally:
And keep fileParallelism: false — the native initRegistry binding can only initialize once per process.