Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Make sure MSW loader is resolved only when mocking is enabled #157

Merged
merged 5 commits into from
Jul 12, 2024

Conversation

yannbf
Copy link
Collaborator

@yannbf yannbf commented Jul 12, 2024

Closes #89

This PR finally solves the inconsistency issues that mswLoaders were trying to initially solve. Before, they were waiting for the service worker to be registered, but we later found out it wasn't enough. Thanks to @kettanaito the loaders should now wait properly.

I manually patched msw to take much longer to register, and Storybook waited and worked as intended with the changes from this PR.

📦 Published PR as canary version: 2.0.3--canary.157.8ab54e9.0

✨ Test out this PR locally via:

npm install msw-storybook-addon@2.0.3--canary.157.8ab54e9.0
# or 
yarn add msw-storybook-addon@2.0.3--canary.157.8ab54e9.0

@yannbf yannbf added the patch Increment the patch version when merged label Jul 12, 2024
Copy link

vercel bot commented Jul 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
msw-storybook-addon ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 12, 2024 10:09am

Copy link
Member

@kettanaito kettanaito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@yannbf yannbf merged commit 7758e8f into main Jul 12, 2024
8 checks passed
@yannbf yannbf deleted the fix/msw-readiness branch July 12, 2024 10:24
Copy link

🚀 PR was released in v2.0.3 🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Story not waiting for MSW to be ready before running
2 participants