diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1213d36..42a76c7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -61,6 +61,39 @@ suite detects the missing binary, prints a clear skip message, and exits 0 spawn/watch/review flows against a local mock LLM server, not just unit-level logic. +## Testing + +`npm test` is fail-fast over every `src/**/*.test.ts` file: the first +failure stops the run, so a red line early in the output can hide hundreds +of unrun files behind it. The tiers below already exist implicitly — this +table names them so a red run is diagnosable without guessing which +external dependency a failure needs. + +| Tier | Command | Needs | Time | A failure means | +| --- | --- | --- | --- | --- | +| 0 — typecheck | `npx tsc --noEmit` | Nothing (no deps beyond `npm install`) | ~1 min | A real type error in `src/`; fix the code, never silence with `any` / `@ts-ignore` / `!`. | +| 1 — unit + fake tests | `npm test` (full) or `npm test -- ` / `npx tsx ` while iterating | Nothing: no network, no key, no private source | Minutes (~~330 files, fail-fast) | A real regression — unless the line says `SKIP`, see below. | +| 2 — private Fleet integration | Same `npm test` run, files matching `fleet` / `repository-budget-v2` | Staged `FLEET_SECURITY_WATCH_TEST_ROOT` (private CI only, via `scripts/stage-fleet-test-source.mjs`) | Skips in seconds without it | `SKIP