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

Updates the Storybook example #48

Merged
merged 2 commits into from
Feb 4, 2021
Merged

Updates the Storybook example #48

merged 2 commits into from
Feb 4, 2021

Conversation

kettanaito
Copy link
Member

@kettanaito kettanaito commented Feb 3, 2021

  • Uses STORY.decorators for per-story API mocks.

@kettanaito
Copy link
Member Author

The tests will fail due to storybookjs/storybook#13801

// 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)
Copy link
Member Author

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.

@kettanaito
Copy link
Member Author

I'm disabling the test until the CSS loading issue with addon-storyshots-puppeteer is resolved.

@kettanaito kettanaito changed the title Updates the Storybook integration Updates the Storybook example Feb 4, 2021
@@ -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",
Copy link
Member Author

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.

@kettanaito kettanaito merged commit b9248fe into master Feb 4, 2021
@kettanaito kettanaito deleted the storybook/update branch February 4, 2021 14:59
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.

1 participant