diff --git a/.changeset/mosaic-colocate-feature-tests.md b/.changeset/mosaic-colocate-feature-tests.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/mosaic-colocate-feature-tests.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.claude/skills/mosaic/references/testing.md b/.claude/skills/mosaic/references/testing.md index 9431c18a6ac..d26bc1b567a 100644 --- a/.claude/skills/mosaic/references/testing.md +++ b/.claude/skills/mosaic/references/testing.md @@ -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. `` 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`,