Description
jest.config.js sets testMatch: ["**/__tests__/**/*.test.ts"], which only matches src/__tests__/streamCache.test.ts. Every other test in the repo is colocated next to its source (for example src/services/accrualService.test.ts, src/repositories/streamRepository.test.ts, src/api/v1/streams.test.ts), exactly as docs/ARCHITECTURE.md and docs/TESTING.md describe — yet npm test silently skips them, so CI's npm test step provides almost no protection. This issue aligns the Jest matcher with the documented colocated layout.
Requirements and context
- Update
testMatch (or switch to testRegex) so all src/**/*.test.ts files run, including the colocated suites and src/__tests__/**.
- Broaden
collectCoverageFrom beyond src/cache/** and src/services/** to reflect the now-running suites, while excluding *.test.ts, type-only files, and src/index.ts bootstrap as appropriate.
- Confirm the existing coverage thresholds remain achievable or adjust them deliberately with justification.
- Non-functional:
npm test must discover and execute the full colocated suite; CI (.github/workflows/ci.yml) requires no change beyond what already runs.
Acceptance criteria
Suggested execution
1. Fork the repo and create a branch — git checkout -b feature/jest-testmatch.
2. Implement changes — edit jest.config.js testMatch/collectCoverageFrom.
3. Write/extend tests — this repo uses Jest + Supertest. No new tests are required, but ensure all previously dormant suites pass once discovered; fix any that fail purely due to never having run.
4. Test and commit —
npm run lint -- --max-warnings 0
npm run build
npm test
Example commit message
test(config): match colocated *.test.ts files so suites run in CI
Guidelines
Preserve the repo coverage standard (95% per jest.config.js) for newly-covered modules where feasible. Update docs/TESTING.md if discovery semantics change. Timeframe: 96 hours.
Description
jest.config.jssetstestMatch: ["**/__tests__/**/*.test.ts"], which only matchessrc/__tests__/streamCache.test.ts. Every other test in the repo is colocated next to its source (for examplesrc/services/accrualService.test.ts,src/repositories/streamRepository.test.ts,src/api/v1/streams.test.ts), exactly asdocs/ARCHITECTURE.mdanddocs/TESTING.mddescribe — yetnpm testsilently skips them, so CI'snpm teststep provides almost no protection. This issue aligns the Jest matcher with the documented colocated layout.Requirements and context
testMatch(or switch totestRegex) so allsrc/**/*.test.tsfiles run, including the colocated suites andsrc/__tests__/**.collectCoverageFrombeyondsrc/cache/**andsrc/services/**to reflect the now-running suites, while excluding*.test.ts, type-only files, andsrc/index.tsbootstrap as appropriate.npm testmust discover and execute the full colocated suite; CI (.github/workflows/ci.yml) requires no change beyond what already runs.Acceptance criteria
npm testdiscovers and runs the colocated suites (test count increases substantially from the current single match).collectCoverageFromcovers the production modules exercised by the now-running tests.npm run buildandnpm testpass locally.docs/TESTING.mdremains accurate with respect to discovery.Suggested execution
1. Fork the repo and create a branch —
git checkout -b feature/jest-testmatch.2. Implement changes — edit
jest.config.jstestMatch/collectCoverageFrom.3. Write/extend tests — this repo uses Jest + Supertest. No new tests are required, but ensure all previously dormant suites pass once discovered; fix any that fail purely due to never having run.
4. Test and commit —
npm run lint -- --max-warnings 0 npm run build npm testExample commit message
Guidelines
Preserve the repo coverage standard (95% per
jest.config.js) for newly-covered modules where feasible. Updatedocs/TESTING.mdif discovery semantics change. Timeframe: 96 hours.