Skip to main content

Testing infrastructure (Vitest, PGlite isolation)

Generated from pattern-library/registry.json — do not edit by hand; change the registry and run bun run patterns:build.

Index card — the docs below are the canonical explanation; deep-tier pattern pages additionally carry invariants and emulation notes.

Category: Architecture & Request Pipeline · Tier: light · Maturity: proven (verified 2026-09-06 @ 4d097488) · Risk: low — structural pattern, no external services

Two vitest lanes over one config: a fast unit lane and a db lane whose files restore a PGlite datadir snapshot built once per run, plus the source-scanning gate tests that ratchet architectural and naming invariants.

When to use: Reach for it when writing tests that need database isolation, when deciding whether a guarantee earns a test at all, or when adding a gate that scans the source tree.

Docs

Code

Tests


Machine-readable record: architecture-testing-infra in pattern-library/registry.json.

← Back to Pattern Library

Think this pattern could be better? Tell us how.

Leave feedback