Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions .changeset/mosaic-colocate-feature-tests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
8 changes: 8 additions & 0 deletions .claude/skills/mosaic/references/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ it('makes the selected organization active and closes', async () => {
`packages/mosaic/src/features/user-button/__tests__/user-button.feature.test.tsx`
is the worked example.

Put a feature test next to the component it renders, and name it after that
component. `<UserProfilePasswordSection />` is tested by
`user-profile-password-section/user-profile-password-section.feature.test.tsx`.
Vitest finds feature tests by the `.feature.test.tsx` suffix, so a shared
`__tests__/` folder buys nothing and makes a section's tests harder to find.
Existing tests in `__tests__/` folders, the worked example included, move when
their feature next changes.

### The toolkit (`src/__tests__/feature/`)

- **`fapi.ts`**: typed builders for FAPI JSON (`fapiEnvironment`, `fapiUser`,
Expand Down
Loading