Skip to content

Commit c598e54

Browse files
authored
Merge pull request #45 from zz-plant/codex/add-testing-section-to-readme
Document testing commands in README
2 parents 9c4e426 + 64d290e commit c598e54

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,20 @@ This repository powers [ethotechnics.org](https://ethotechnics.org), a content-d
1212

1313
Use `npm run check` for a full pre-commit sweep. It will run linting, tests, TypeScript checks, and Astro's checker (skipping any step that is not configured).
1414

15-
## End-to-end tests
15+
## Testing
1616

17-
- `npm run e2e` builds the Worker bundle and runs Playwright against `npm run preview`.
18-
- Override the preview target with `PLAYWRIGHT_BASE_URL` (defaults to `http://127.0.0.1:4321`).
19-
- CI uses `npm run e2e:ci` and publishes the Playwright HTML report as a workflow artifact.
17+
### Unit and component tests (Vitest)
18+
19+
- `npm test` runs Vitest in watch mode. Expect green checkmarks per suite and a summary such as `Test Files 3 passed` and `Tests 7 passed` when everything succeeds.
20+
- Component rendering tests use the experimental Astro container (`src/test/astro-container.ts`) and run under Node with jsdom helpers, so no browser is required.
21+
- CI uses `npm run test:ci` to execute once with coverage; mirror this locally to see the coverage table emitted at the end of the run.
22+
23+
### End-to-end tests (Playwright)
24+
25+
- Install Playwright browsers once with `npx playwright install --with-deps` so local runs match CI; Linux dependencies are included in that command.
26+
- `npm run e2e` builds the Worker bundle and runs Playwright against `npm run preview` on `http://127.0.0.1:4321` (override with `PLAYWRIGHT_BASE_URL`). Successful runs show Playwright's test list with ✅ markers and a final summary of passed specs and duration.
27+
- For iterative debugging, start the preview server separately (`npm run build && npm run preview`) in one terminal and run `npm run e2e` in another to reuse the server instead of rebuilding each time.
28+
- CI uses `npm run e2e:ci`, which emits line-reporter output and publishes the Playwright HTML report as a workflow artifact.
2029

2130
### Environment configuration
2231

0 commit comments

Comments
 (0)