Testing
How we ensure quality and reliability across the Riverside Herald codebase.
π Coverage (Last Run)
Loading coverageβ¦
π What Happens During Testing
1
Unit Tests
Vitest + React Testing Library
Individual components and functions are tested in isolation. Mocks replace external dependencies.
- β’Components render correctly with given props
- β’User interactions trigger expected handlers
- β’Conditional rendering based on state
2
Coverage Report
Vitest + v8
Code coverage measures which lines, branches, and functions are exercised by tests.
- β’Statements: % of executable statements run
- β’Branches: % of conditional paths taken
- β’Functions: % of functions called
- β’Lines: % of lines executed
3
End-to-End (E2E)
Cypress
Real browser tests against a running app. Tests full user journeys.
- β’Login, register flows
- β’Article browsing and business directory
- β’Form submissions and API round-trips
Commands
$ npm run testβ Single run
$ npm run test:watchβ Watch mode
$ npm run test:coverage:publicβ Generate coverage and copy to Testing page
$ npm run test:e2eβ Cypress E2E (headless)
$ npm run test:e2e:openβ Cypress E2E (interactive)