-
-
Notifications
You must be signed in to change notification settings - Fork 145
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
Compatibility Issue with jest-styled-components
and Storybook's test-runner
#443
Comments
I am having the same issue |
The issue with Problem Analysis
Potential Solutions
Suggested WorkaroundIn your specific repository setup, try the following:
|
Issue Overview.
I am experiencing a problem with
jest-styled-components
not working as expected when usingtest-runner
in Storybook. The problem seems to be caused by the waytest-runner
handles rendering.Add the serializer from
jest-styled-components/serializer
to test-runner-jest.config.jsExecute snapshot by test-runner.
I get the following snapshot, but it does not show the css associated with the class.
Detailed Description.
Non-Operational
jest-styled-components
: If you try to usejest-styled-components
withstorybook
test-runner
, it will not work correctly. It seems thattest-runner
is incompatible withjest-styled-components
.Rendering with headless browser:** Storybook's
test-runner
uses a headless browser to render React components. This process results in output that is different from what thejest-styled-components
serializer expects. jest-styled-components` standard input is usually a ReactNode or HTMLElement, but output from a headless browser does not match this format.Seeking a Solution
Are there any known solutions or workarounds for this problem?
Sample Repository
https://github.com/naporin0624/test-runner-jest-styled-components
The text was updated successfully, but these errors were encountered: