-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
TypeError: val.entries is not a function #4922
Comments
As workaround, I noticed that if I wrap the component (in the test file) inside a
|
/cc @pedrottimark |
@FezVrasta 2 things so far. First I am sure. Second is opportunity for us to learn together :) First: By design, enzyme wrappers are not intended for snapshots. But there is a helper:
Second: It still fails with the same error as you reported. For reason that I do not yet understand, the value of the However, in quick reading about It describes a The following change to the component: export default CSS(
function Demo({styles}) {
return <div className={styles.Dummy} />;
},
styles,
{ allowMultiple: true }
); Produces the following snapshot: <div
className="Dummy"
/> But I have no idea if that change is a step closer to or farther from your goal :) |
Hey. I haven't used enzyme-to-json just to avoid any additional dep in the repro About "styles" property. It's documented as way to override the styles of an existing styled component.
https://github.com/gajus/react-css-modules#extending-component-styles |
@FezVrasta Thank you for the sample project. Fixed by #4935 Here is an example of a shallow snapshot: <Table styles={Object {}} /> For more information about |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Do you want to request a feature or report a bug?
bug
What is the current behavior?
(the additional stack trace is added by me with a console.trace() placed in the problematic file)
If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can
yarn install
andyarn test
.Just run this repository tests to get the error:
https://github.com/FezVrasta/jest-pretty-print-bug
What is the expected behavior?
No errors pretty please 🙏
Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.
Look at the repository provided please.
The text was updated successfully, but these errors were encountered: