diff --git a/.gitignore b/.gitignore index a38b2af..75c3f0a 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ npm-debug.log* # Metro metro-cache/ +coverage/ diff --git a/README.md b/README.md index 6835a06..058f103 100644 --- a/README.md +++ b/README.md @@ -224,6 +224,25 @@ npm run android # Android npm run ios # iOS (Mac only) ``` +### CI Quality Gates + +Before opening a PR, run the full local quality gate to ensure CI will pass: + +```bash +# 1. Type-check the entire codebase (must produce zero errors) +npm run typecheck + +# 2. Run all unit tests with coverage enforcement +# Overall line/function/branch/statement coverage must stay >= 75% +npm run test:coverage + +# 3. Lint +npm run lint +``` + +> **Note:** `npm test` (used in CI) runs without the `--coverage` flag for speed. +> Use `npm run test:coverage` locally to verify you have not dropped coverage below the 75% threshold. + ### Environment Variables ```env @@ -296,8 +315,11 @@ npm run typecheck # Run unit tests (135 tests) npm test -# Run with coverage -npm test -- --coverage +# Run tests with coverage enforcement (>= 75% lines/functions/branches/statements) +npm run test:coverage + +# Type-check the entire codebase (zero TypeScript errors required) +npm run typecheck # Run integration tests (requires running backend) npm run test:integration @@ -335,6 +357,10 @@ actually supports. ### Test Coverage +The project enforces a **75% minimum coverage threshold** across lines, functions, +branches, and statements. Run `npm run test:coverage` before opening a PR to +verify you have not regressed below the threshold. + | Category | Tests | Files | | ------------------- | ----- | ----------------------------------------------------------------------------------------------------------- | | Store logic | 19 | walletStore, taskStore, userStore, activityStore |