Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion ai/rules/tdd.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ For Vitest/Riteway tests:
- Module mocking: vi.mock with vi.importActual for partial mocks
- Works cleanly with ESM. Avoid require.
- Timers: vi.useFakeTimers and vi.setSystemTime
- UI testing strategy:
- Redux actions/selectors: Pure tests (no component rendering needed)
- Side effects: must be isolated from UI, see `javascript/javascript-io-network-effects.mdc`
- Component rendering: Use riteway/render for markup verification
- Browser interactions: Use Playwright to exercise real browser APIs
- Never use @testing-library/react (redundant with above patterns)

Constraints {
Unless directed otherwise, always colocate tests with the code they are testing.
Expand All @@ -78,4 +84,4 @@ State {
libraryStack // e.g. React + Redux + Redux Saga
}

/welcome
/welcome
Loading