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!