Summary
.github/workflows/ci.yml runs four jobs today: lint-imports, build, type-check, and contracts. None of them executes the test suite, so regressions in any of the ~25 existing *.spec.ts files reach main undetected. The root package.json even ships a placeholder script:
"test": "echo \"Error: no test specified\" && exit 1"
while backend/package.json defines working scripts (test, test:cov, test:e2e) that nothing invokes.
What exists today
- Unit specs:
backend/src/analytics/** (providers, listeners, jobs, guards), backend/src/score/providers/score.service.spec.ts, backend/src/blockchain/**, backend/src/challenge-attempt/providers/*.spec.ts, backend/src/game-sessions/providers/*.spec.ts, backend/src/health/*.spec.ts, backend/src/rewards/providers/reward.service.spec.ts, backend/src/auth/providers/guest-session.provider.spec.ts, backend/src/users/providers/xp-level.service.spec.ts
- E2E specs:
backend/test/app.e2e-spec.ts, backend/test/analytics.e2e-spec.ts (config: backend/test/jest-e2e.json)
Proposed change
- Add a
test job to .github/workflows/ci.yml: npm --workspace backend run test -- --ci --runInBand (unit) and optionally the e2e suite against a service container (postgres/redis).
- Point the root
test script at the workspace suites (npm --workspace backend run test) or remove it.
- Consider uploading coverage (
jest --coverage) as a PR artifact.
Acceptance criteria
Summary
.github/workflows/ci.ymlruns four jobs today:lint-imports,build,type-check, andcontracts. None of them executes the test suite, so regressions in any of the ~25 existing*.spec.tsfiles reachmainundetected. The rootpackage.jsoneven ships a placeholder script:while
backend/package.jsondefines working scripts (test,test:cov,test:e2e) that nothing invokes.What exists today
backend/src/analytics/**(providers, listeners, jobs, guards),backend/src/score/providers/score.service.spec.ts,backend/src/blockchain/**,backend/src/challenge-attempt/providers/*.spec.ts,backend/src/game-sessions/providers/*.spec.ts,backend/src/health/*.spec.ts,backend/src/rewards/providers/reward.service.spec.ts,backend/src/auth/providers/guest-session.provider.spec.ts,backend/src/users/providers/xp-level.service.spec.tsbackend/test/app.e2e-spec.ts,backend/test/analytics.e2e-spec.ts(config:backend/test/jest-e2e.json)Proposed change
testjob to.github/workflows/ci.yml:npm --workspace backend run test -- --ci --runInBand(unit) and optionally the e2e suite against a service container (postgres/redis).testscript at the workspace suites (npm --workspace backend run test) or remove it.jest --coverage) as a PR artifact.Acceptance criteria
npm testno longer prints "Error: no test specified".