-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
Updates the Storybook example #48
Conversation
The tests will fail due to storybookjs/storybook#13801 |
da01832
to
48d0bad
Compare
// Export the worker instance, so we can await the activation on Storybook's runtime. | ||
// You can use this reference to start the worker for local development as well. | ||
export const worker = | ||
typeof global.process === 'undefined' && setupWorker(...handlers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a mess. I've raised it here storybookjs/storybook#11378 (comment) to see if there's a better way.
Each story executes both in NodeJS and in a browser. I see no way to import the worker in a browser only.
I'm disabling the test until the CSS loading issue with |
@@ -2,27 +2,27 @@ | |||
"name": "with-storybook", | |||
"version": "0.0.0", | |||
"scripts": { | |||
"storybook": "start-storybook -p 6006 -s public", | |||
"storybook": "start-storybook -h localhost -p 6006 -s public", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Storybook started to open at an absolute address now. MSW cannot be registered on an absolute address unless you a) whitelist that addresse as secure, b) load that address via HTTPS. Both options are overcomplicated for the example's purpose.
STORY.decorators
for per-story API mocks.