Skip to content

docs(repo): colocate Mosaic feature tests with their component - #10076

Merged
alexcarpenter merged 2 commits into
mainfrom
alex/mosaic-colocate-feature-tests
Oct 5, 2026
Merged

alexcarpenter merged 2 commits into
mainfrom
alex/mosaic-colocate-feature-tests

Conversation

@alexcarpenter

Copy link
Copy Markdown
Member

Description

The Mosaic testing guide now says to put a feature test next to the component it renders and to name it after that component. For example, <UserProfilePasswordSection /> is tested by user-profile-password-section/user-profile-password-section.feature.test.tsx.

Vitest finds feature tests by their .feature.test.tsx suffix, so the shared __tests__/ folders aren't needed. They also make it hard to find a section's tests: features/user-profile/__tests__/ has about 49 files. Existing tests in __tests__/ folders move the next time their feature changes. They aren't moved in this PR.

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@vercel

vercel Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
clerk-js-sandbox Ready Ready Preview Oct 5, 2026 8:56pm UTC
swingset Ready Ready Preview Oct 5, 2026 8:56pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8e302b9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository YAML (base), Organization UI (inherited)
  • Review profile: ASSERTIVE
  • Plan: Team
  • Run ID: 1081d0c2-b267-40b6-b674-155e25bd7c5b
📥 Commits

Reviewing files that changed from the base of the PR and between 0352918 and 8e302b9.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository YAML (base), Organization UI (inherited)
  • Review profile: ASSERTIVE
  • Plan: Team
  • Run ID: d3c919b0-3268-4061-92d4-17b051b1ae57
📥 Commits

Reviewing files that changed from the base of the PR and between 55a1d5b and 0352918.

📒 Files selected for processing (2)
  • .changeset/mosaic-colocate-feature-tests.md
  • .claude/skills/mosaic/references/testing.md
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. 5 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 6 reviews per hour.


📝 Walkthrough

Walkthrough

The testing guidance now says to place each feature test beside the component it renders and name it after that component. It identifies the .feature.test.tsx discovery suffix and recommends moving tests from shared __tests__/ folders when their feature next changes. The changeset file contains an empty frontmatter block.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: ephem

Merge Risk: ⚪ Minimal · up to 03529

The feature-test guidance matches the configured test discovery, and the empty changeset does not disrupt release status. No actionable merge risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: updating the Mosaic guide to colocate feature tests with their components.
Description check ✅ Passed The description explains the test placement guidance, Vitest discovery, and the plan for existing tests. It is related to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@10076

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@10076

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@10076

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@10076

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@10076

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@10076

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@10076

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@10076

@clerk/expo-biometrics

npm i https://pkg.pr.new/@clerk/expo-biometrics@10076

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@10076

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@10076

@clerk/express

npm i https://pkg.pr.new/@clerk/express@10076

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@10076

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@10076

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@10076

@clerk/mosaic

npm i https://pkg.pr.new/@clerk/mosaic@10076

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@10076

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@10076

@clerk/react

npm i https://pkg.pr.new/@clerk/react@10076

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@10076

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@10076

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@10076

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@10076

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@10076

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@10076

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@10076

commit: 8e302b9

@alexcarpenter
alexcarpenter enabled auto-merge (squash) October 5, 2026 20:54
@alexcarpenter
alexcarpenter merged commit aad46e3 into main Oct 5, 2026
48 of 50 checks passed
@alexcarpenter
alexcarpenter deleted the alex/mosaic-colocate-feature-tests branch October 5, 2026 20:56
alexcarpenter added a commit that referenced this pull request Oct 5, 2026
…onent

Follows the convention landed in #10076: a feature test lives next to the component it renders.

This branch was successfully deployed

2 active deployments
Preview – swingset — 8e302b93 Deployed Oct 5, 2026 by vercel[bot]
Preview – clerk-js-sandbox — 8e302b93 Deployed Oct 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants