Open ismay opened 7 years ago
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.
I think the problem is this: https://github.com/facebook/jest/issues/3535. My config is:
{
"snapshotSerializers": [
"<rootDir>/node_modules/jest-serializer-enzyme"
]
}
And apparently rootDir isn't being resolved anymore.
@ismay yup, you should just have:
{
"snapshotSerializers": [
"jest-serializer-enzyme"
]
}
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.