You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
npm test fails on a clean checkout and frontend unit tests never run in CI #92
npm test (vitest) fails on a clean checkout — it collects the Playwright specs in e2e/ and every one of them errors.
The frontend-ci job never runs npm test, so the failure is invisible and the 108 frontend unit tests added for the frontend-unit-tests issue are not enforced on any pull request.
The Playwright specs live in e2e/ — playwright.config.ts sets testDir: './e2e'. The playwright/ directory still contains onboarding-journeys.spec.ts, byte-identical to e2e/onboarding-journeys.spec.ts, and is outside testDir, so that copy is never executed by Playwright either. Vitest excludes the dead directory and collects the live one.
Why CI did not catch it
frontend-ci runs npm ci → npm run lint → npm run build. There is no test step. The other jobs run npm run test:pact and npm run test:e2e, so Pact and Playwright are covered, but the vitest suite is not.
Requirements
Fix the vitest exclude so it matches the real Playwright directory (e2e/**), or scope vitest's include to src/**.
Delete the orphaned src/frontend/playwright/ directory — it is a stale duplicate that no runner executes.
Add a test step to frontend-ci so a failing unit test blocks the pull request.
Consider uploading vitest coverage as a build artifact, matching the backend job's behaviour.
Acceptance Criteria
npm test exits 0 on a clean checkout of main.
npm test reports 20 passed (20) test files — no Playwright spec is collected by vitest.
src/frontend/playwright/ no longer exists, and npm run test:e2e still runs the full e2e/ suite.
frontend-ci runs npm test and the job fails when a unit test fails (demonstrate with a deliberately broken test on a scratch branch).
Introducing a failing vitest assertion causes a red CI check on a pull request.
Note on the second acceptance criterion, which cannot be satisfied as written:
npm test reports 20 passed (20) test files — no Playwright spec is collected by vitest.
20 was the total including the 6 Playwright specs that should not be collected at all. With them correctly excluded the count cannot be 20. At the time of the fix vitest reported 14 files; it is 18 now that further tests have been added.
The criterion's intent — no Playwright spec collected by vitest — is met and asserted: npx playwright test --list still finds all 26 tests across 6 files, and npm test collects only src/**.
The remaining criterion, that a failing assertion turns a PR red, was demonstrated on a throwaway branch (#98, now closed and deleted): Frontend — lint, test & build failed at the Unit tests (vitest) step and the Build step was skipped.
Activity
test: close acceptance-criteria gaps left in the gap-review work
MaximumTrainer commentedon Sep 13, 2026
Note on the second acceptance criterion, which cannot be satisfied as written:
20 was the total including the 6 Playwright specs that should not be collected at all. With them correctly excluded the count cannot be 20. At the time of the fix vitest reported 14 files; it is 18 now that further tests have been added.
The criterion's intent — no Playwright spec collected by vitest — is met and asserted:
npx playwright test --liststill finds all 26 tests across 6 files, andnpm testcollects onlysrc/**.The remaining criterion, that a failing assertion turns a PR red, was demonstrated on a throwaway branch (#98, now closed and deleted):
Frontend — lint, test & buildfailed at theUnit tests (vitest)step and the Build step was skipped.