Desired outcome
.github/workflows/ci.yml runs the Vitest suite on every push and pull request, and a failing test blocks the merge.
Why it matters
The repo has real tests (lib/utils/urls.test.ts, lib/utils/pii.test.ts, app/api/posts/route.test.ts, app/api/admin/posts/route.test.ts, app/api/posts/edit/[token]/route.test.ts, app/api/teams/waitlist/route.test.ts) and a vitest.config.ts, but CI only does type check, lint, format check, and build. Nothing in CI ever executes them, so a PR can break every test and still go green.
Steps
- In
package.json, add a non-watch script, for example "test:ci": "vitest run". The current "test": "vitest" starts watch mode and would hang a CI runner.
- In
.github/workflows/ci.yml, add a test job (or a step in lint-and-typecheck) that runs npm ci then npm run test:ci.
- Copy the placeholder env block already used by the
build job if any test needs IP_HASH_PEPPER or the Supabase vars.
Claiming this
Comment below to claim it. A reply usually comes within a day.
Desired outcome
.github/workflows/ci.ymlruns the Vitest suite on every push and pull request, and a failing test blocks the merge.Why it matters
The repo has real tests (
lib/utils/urls.test.ts,lib/utils/pii.test.ts,app/api/posts/route.test.ts,app/api/admin/posts/route.test.ts,app/api/posts/edit/[token]/route.test.ts,app/api/teams/waitlist/route.test.ts) and avitest.config.ts, but CI only does type check, lint, format check, and build. Nothing in CI ever executes them, so a PR can break every test and still go green.Steps
package.json, add a non-watch script, for example"test:ci": "vitest run". The current"test": "vitest"starts watch mode and would hang a CI runner..github/workflows/ci.yml, add atestjob (or a step inlint-and-typecheck) that runsnpm cithennpm run test:ci.buildjob if any test needsIP_HASH_PEPPERor the Supabase vars.Claiming this
Comment below to claim it. A reply usually comes within a day.