Testing infrastructure (Vitest, PGlite isolation)
Generated from
pattern-library/registry.json— do not edit by hand; change the registry and runbun 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
- docs/blueprint/testing/strategy.md (GitHub · GitLab)
- docs/blueprint/testing/ai-testing-infrastructure.md (GitHub · GitLab)
Code
Tests
Machine-readable record: architecture-testing-infra in pattern-library/registry.json.