Skip to content

v3.0 - Enzyme 3 and React 16 compatibility

Compare
Choose a tag to compare
@adriantoine adriantoine released this 26 Sep 17:38
· 110 commits to master since this release

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 of null

  • 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 the react-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 and mountToDeepJson are replaced by a mode option in mountToJson:

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!