Testing Strategy
Guardrails
- Test files live in
__tests__/directories - Coverage thresholds enforced: 80% for statements, branches, functions, lines
- No snapshot tests
- Full suite runs on PRs (unit + integration)
import type { Config } from 'jest';
const config: Config = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>/apps', '<rootDir>/packages'],
collectCoverage: true,
coverageDirectory: 'coverage',
coverageThreshold: { global: { branches: 80, functions: 80, lines: 80, statements: 80 } }
};
export default config;
LLM Notes
- Prefer unit tests for logic. Use integration tests when hitting real services/emulators.
- Include tests and adjust thresholds only via ADR if you must relax them.