Repository navigation
test(mosaic): give each feature test its own fake FAPI host - #10183
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: b8fa912 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen 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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (6)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Included review availability: This review used your included allowance. 1 included review remains after this review. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour. 📝 WalkthroughWalkthroughThe fake FAPI now uses a numbered host that changes before each browser test. Its worker allows requests to the current host and returns a network error for requests to other hosts. New tests cover in-flight and delayed requests crossing test boundaries. The testing documentation describes this behavior and retains the existing cleanup and failure checks. Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~12 minutes Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue is established; the change is ready for normal checks. Pre-merge checks |
|
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-biometrics
@clerk/expo-google-signin
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/mosaic
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
Description
Mosaic feature tests share one MSW worker and, until now, one fake FAPI host. Each test creates a new
Clerkthat is never torn down, so a request a previous test's Clerk sends late (an in-flight fetch, a debounced search) can be matched by the next test's handlers. That is howorganization-profile-requests.feature.test.tsxfailed in this run: aholdRequestshold counted a members request left over from the previous test.Each test now gets its own FAPI host. The setup file switches the host before every test, the publishable key is built from it, and a permanent fallback handler answers requests to any older host with a network error. A late request from a previous test fails instead of reaching the current test's handlers, and never goes to the real network. The unhandled-request check only looks at the current host.
fake-fapi-isolation.feature.test.tsxleaves a request in flight, and schedules one after the test ends, then checks the next test's handlers don't see either.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change