Add Vitest test runner to westside-landing #247

Open
opened 2026-04-10 22:18:02 +00:00 by forgejo_admin · 0 comments
Contributor

Type

Feature

Lineage

Discovered 2026-04-10 during westside-landing#243 (T1 of System B jersey intake). The T1 dev agent could not satisfy its Test Expectations acceptance criteria because westside-landing has no test runner configured — package.json scripts are only dev, build, preview, check. Vitest is the standard SvelteKit test runner and is trivial to add, but warrants its own ticket.

Repo

forgejo_admin/westside-landing

User Story

As a dev agent building SvelteKit features in westside-landing
I want a working npm run test command backed by Vitest
So that ticket acceptance criteria that specify component/unit tests can actually be satisfied, and so new code lands with test coverage rather than only manual verification

Context

westside-landing is a production SvelteKit app deployed to westsidekingsandqueens.tail5b443a.ts.net. Multiple in-flight tickets (T1 #243, T6 #244) specify Svelte component tests in their Test Expectations. Without Vitest these ACs are unenforceable and the agents have to flag them as deferred.

Vitest is the Svelte-recommended runner and integrates with SvelteKit via vitest + @testing-library/svelte + a minimal vitest.config.ts. No build system changes required.

File Targets

Files to create:

  • vitest.config.ts — minimal config importing the SvelteKit vite plugin
  • src/setupTests.ts — optional, adds @testing-library/jest-dom matchers

Files to modify:

  • package.json — add test and test:watch scripts; add vitest, @testing-library/svelte, @testing-library/jest-dom, jsdom to devDependencies

Files the agent should NOT touch:

  • Any existing src/ component or route — this ticket is infrastructure only
  • svelte.config.js — should not need changes

Acceptance Criteria

  • npm run test runs Vitest and exits 0 with "No tests found" (or equivalent) on a fresh checkout
  • npm run test:watch starts Vitest in watch mode
  • A trivial smoke test (e.g. tests/smoke.test.ts with expect(1+1).toBe(2)) runs green
  • A trivial Svelte component test using @testing-library/svelte renders a hello-world component and asserts on its text
  • npm run build still succeeds (no regression)
  • npm run check still passes (no new type errors)

Test Expectations

  • npm run test — must exit 0
  • The smoke test and component test are committed so CI has something to run

Constraints

  • Use Vitest (not Jest, Mocha, Playwright component tests, etc.) — it's the SvelteKit-default
  • Do NOT add Tailwind, PostCSS, or any unrelated tooling while at it
  • Pin all new devDependencies to specific versions (no ^ ranges) to avoid surprise breakage
  • Do NOT add any e2e test runner in this ticket — this is unit/component only

Checklist

  • PR opened against westside-landing main
  • npm install runs cleanly in a fresh clone
  • npm run test passes
  • npm run build still passes
  • No changes to existing source files
  • westside-basketball — project
  • story:WS-S31 — this story's existing tickets (T1 #243, T6 #244) block on not being able to write the tests they spec
  • Discovered by: westside-landing#243 dev agent on 2026-04-10
### Type Feature ### Lineage Discovered 2026-04-10 during `westside-landing#243` (T1 of System B jersey intake). The T1 dev agent could not satisfy its `Test Expectations` acceptance criteria because westside-landing has no test runner configured — `package.json` scripts are only `dev`, `build`, `preview`, `check`. Vitest is the standard SvelteKit test runner and is trivial to add, but warrants its own ticket. ### Repo `forgejo_admin/westside-landing` ### User Story As a dev agent building SvelteKit features in westside-landing I want a working `npm run test` command backed by Vitest So that ticket acceptance criteria that specify component/unit tests can actually be satisfied, and so new code lands with test coverage rather than only manual verification ### Context westside-landing is a production SvelteKit app deployed to `westsidekingsandqueens.tail5b443a.ts.net`. Multiple in-flight tickets (T1 #243, T6 #244) specify Svelte component tests in their Test Expectations. Without Vitest these ACs are unenforceable and the agents have to flag them as deferred. Vitest is the Svelte-recommended runner and integrates with SvelteKit via `vitest` + `@testing-library/svelte` + a minimal `vitest.config.ts`. No build system changes required. ### File Targets Files to create: - `vitest.config.ts` — minimal config importing the SvelteKit vite plugin - `src/setupTests.ts` — optional, adds `@testing-library/jest-dom` matchers Files to modify: - `package.json` — add `test` and `test:watch` scripts; add `vitest`, `@testing-library/svelte`, `@testing-library/jest-dom`, `jsdom` to devDependencies Files the agent should NOT touch: - Any existing `src/` component or route — this ticket is infrastructure only - `svelte.config.js` — should not need changes ### Acceptance Criteria - [ ] `npm run test` runs Vitest and exits 0 with "No tests found" (or equivalent) on a fresh checkout - [ ] `npm run test:watch` starts Vitest in watch mode - [ ] A trivial smoke test (e.g. `tests/smoke.test.ts` with `expect(1+1).toBe(2)`) runs green - [ ] A trivial Svelte component test using `@testing-library/svelte` renders a hello-world component and asserts on its text - [ ] `npm run build` still succeeds (no regression) - [ ] `npm run check` still passes (no new type errors) ### Test Expectations - [ ] `npm run test` — must exit 0 - [ ] The smoke test and component test are committed so CI has something to run ### Constraints - Use Vitest (not Jest, Mocha, Playwright component tests, etc.) — it's the SvelteKit-default - Do NOT add Tailwind, PostCSS, or any unrelated tooling while at it - Pin all new devDependencies to specific versions (no `^` ranges) to avoid surprise breakage - Do NOT add any e2e test runner in this ticket — this is unit/component only ### Checklist - [ ] PR opened against `westside-landing` main - [ ] `npm install` runs cleanly in a fresh clone - [ ] `npm run test` passes - [ ] `npm run build` still passes - [ ] No changes to existing source files ### Related - `westside-basketball` — project - `story:WS-S31` — this story's existing tickets (T1 #243, T6 #244) block on not being able to write the tests they spec - Discovered by: `westside-landing#243` dev agent on 2026-04-10
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/westside-app#247
No description provided.