Map of Content for the test suite (10 notes covering 27 test files / 6,538 lines). Test runner is bun test.

Start here

Test Strategy — how the suite is organized, env vars, what’s mocked vs live. Test Coverage Gaps — every untested src module ranked by risk.

Strategy and gaps

By area

  • API Tests — 12 REST integration files; flagged tests/api/index.test.ts:646–654 deletes any row matching email LIKE '%@example.com' (destructive)
  • Enrichment Tests — processors, crawlee-quality, firecrawl, board-members; flagged ~40% duplication between processors.test.ts and enrichmentEngine.v7.test.ts
  • Fetcher Tests — SCB and Bolagsverket; flagged empty test body at tests/fetchers/bolagsverket.test.ts:53–60
  • Domain Discovery Tests — 2 negative-only assertions, no offline mode
  • Speed Tests — 50ms registry budget, flake risk
  • Compliance Tests — hashing, RoPA, opt-out, queue smoke, Article 14
  • Validation Tests — split: input validators vs four-layer engine smoke
  • Regression Guard Tests — autoresearch must-reject / must-accept lists, blocklist integrity

Verified bugs

  • Destructive cleanup in tests/api/index.test.ts:646–654
  • Empty test body at tests/fetchers/bolagsverket.test.ts:53–60
  • src/integration.test.ts Update_Job test re-implements the worker handler (drift won’t be caught)
  • tests/api/security.test.ts bcrypt-cost test only verifies imports

See Dashboard §Coverage health for the gap chart.

See also