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

Snapshots tests fail for jest 20 with jest-serializer-enzyme #13

Open
ismay opened this issue May 7, 2017 · 3 comments
Open

Snapshots tests fail for jest 20 with jest-serializer-enzyme #13

ismay opened this issue May 7, 2017 · 3 comments

Comments

@ismay
Copy link

ismay commented May 7, 2017

When upgrading to jest 20 the snapshot tests I'm running with shallow rendering fail because the results aren't being serialized anymore:

According to the jest docs and blog there shouldn't be any breaking changes that affect this:

But still they're failing (it's rendering the shallow wrapper directly, instead of the serialized result), while tests that aren't using enzyme pass. I was wondering if there is anything that needs to be changed when using this library with jest 20.

@ismay
Copy link
Author

ismay commented May 9, 2017

Using ReactShallowRenderer seems to fix it though. So I'm not sure what's going on here. Seems to me that it's the serialization, but I could be wrong.

@ismay
Copy link
Author

ismay commented May 10, 2017

I think the problem is this: jestjs/jest#3535. My config is:


{
  "snapshotSerializers": [
    "<rootDir>/node_modules/jest-serializer-enzyme"
  ]
}

And apparently rootDir isn't being resolved anymore.

@mAiNiNfEcTiOn
Copy link

@ismay yup, you should just have:

{
  "snapshotSerializers": [
    "jest-serializer-enzyme"
  ]
}

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

No branches or pull requests

2 participants