Releases: adriantoine/enzyme-to-json
Releases · adriantoine/enzyme-to-json
v3.0 - Enzyme 3 and React 16 compatibility
There it is, a new major version!
Features
- Works with Enzyme v3 and React 16
- Support top level array components (new in React 16)
- Remove mountToShallowJson and mountToDeepJson and use options instead
- Simplified Readme
- Refactor documentation
- TypeScript bindings
Breaking changes
-
Components returning
null
or any falsy value are now rendered as an empty string in snapshots instead ofnull
-
Shallow wrapper are now outputting
undefined
props:
<BasicWithUndefined>
- <button>
+ <button
+ disabled={undefined}
+ >
Hello
</button>
</BasicWithUndefined>
-
This use case won't be supported anymore, it seems incorrect anyway to pass
this
as a prop and I can see no usage of this in thereact-bootstrap
documentation anyway -
This use case won't be supported either as it doesn't seem to be supported by Enzyme either, you will just have to use their
simulate
helper to do that -
mountToShallowJson
andmountToDeepJson
are replaced by amode
option inmountToJson
:
mountToShallowJson(wrapper);
// ==>
mountToJson(wrapper, {mode: 'shallow'});
mountToDeepJson(wrapper);
// ==>
mountToJson(wrapper, {mode: 'deep'});
Bugs
Please report any bugs in the GitHub issues tab as soon as you find them. Thanks!
v2.0.1
v3.0.0-beta6
For more info about v3.0.0, see #67
v2.0.0
- Added
key
prop to snapshots, you can opt-out using thenoKey
option.
v1.6.0
v1.5.1
v1.5.0
v1.4.6
<a name"1.4.6">