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
[Bug]: @storybook/test
breaks react-native storybook
#26947
Labels
Comments
hamsteven
changed the title
[Bug]:
[Bug]: Apr 24, 2024
@storybook/test
fails the bundling and hoses the terminal for react-native storybook @storybook/test
breaks react-native storybook
For react native itself the best you can do is unit tests with composeStories or write explicit integration tests with maestro or detox etc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
I have shared stories for storybook for web and storybook for react-native. They all contain the play function for interaction testing. The
@storybook/test
import int the stories fails the bundling process for web and native when starting up storybook for react-native.Using https://storybook.js.org/addons/@storybook/addon-interactions for web breaks my react-native implementation of storybook. If I comment out the line below and mock out those imports then everything starts normally.
The line in my stories that breaks the app (both my normal app and storybook for react native) and causes the terminal to hang:
import { userEvent, within, expect, fn, waitFor } from "@storybook/test";
The addon-interactions addon is not in the react-native config and I just have it in my web storybook as seen below. The bundling goes to 100% but the terminal locks up and my expo app locks up on startup at the same time:
Eventually I get "There was a problem loading the project" in my ios simulator.
When I add the addon-interactions addon to my react-native storybook like below:
then I get the following error:
How do I work around this where I can use one story for both react and react-native versions of storybook?
To Reproduce
I went by Danny's implementation of both react and react-native side-by-side storybook example.
System
Additional context
...
"storybook": "^8.0.6",
The text was updated successfully, but these errors were encountered: