Testing
Unit tests cover redaction, state transitions, glob precedence, JSON mutation, extraction, assertions, and contract behavior. API integration tests inject in-memory ports. Browser scenarios use the deterministic local fixture instead of third-party sites.
npm run test:coverage uses the V8 provider and enforces global thresholds over deterministic domain and security modules. Browser orchestration is covered by Playwright golden scenarios. PostgreSQL repositories, migrations, Redis-backed BullMQ processing, concurrent idempotency, and stalled-worker recovery are exercised by tests/infrastructure.test.ts whenever the isolated TEST_DATABASE_URL and TEST_REDIS_URL are configured. Recovery reconciles both the BullMQ lease and WebProbe's durable run and attempt state; CI always provides both services.
Golden flows cover basic scrape, dynamic rendering, a mocked checkout failure, a delayed dependency, contract violation, and a broken-site crawl. Run type checking, Vitest, Playwright Test, and the docs build before merging.