Releases: adriantoine/enzyme-to-json
Releases · adriantoine/enzyme-to-json
v1.4.3
v1.4.2
v1.4.1
v1.4.0
<a name"1.4.0">
1.4.0 (2016-12-06)
One function to rule them all
You don't need shallowToJson
, mountToJson
and renderToJson
anymore, just use one toJson
function:
import toJson from 'enzyme-to-json';
the wrapper type is now detected internally using instanceof
.
Serializer
Inspired by jest-serializer-enzyme, you can now use a jest snapshot serializer with the output of enzyme-to-json
.
Add this to your jest configuration:
"jest": {
"snapshotSerializers": ["<rootDir>/node_modules/enzyme-to-json/serializer"]
}
Then you can have an Enzyme serialization without having to import or use any of the toJson
functions! And it has the same output as the good old xxxxToJson
helpers.