Skip to content

Releases: adriantoine/enzyme-to-json

v3.0 - Enzyme 3 and React 16 compatibility

26 Sep 17:38
Compare
Choose a tag to compare

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!

v2.0.1

25 Sep 20:05
Compare
Choose a tag to compare

Reintroduced Node 4 support (#71)

v3.0.0-beta6

25 Sep 20:05
Compare
Choose a tag to compare
v3.0.0-beta6 Pre-release
Pre-release

For more info about v3.0.0, see #67

v2.0.0

17 Sep 14:55
Compare
Choose a tag to compare

v1.6.0

15 Sep 11:09
Compare
Choose a tag to compare
  • Use .getNode and .getNodes if available for implicit updates (#62)
  • Fix problem with ShallowComponentWrapper and _reactInternalInstance (#59)
  • Add mountToDeepJson and mountToShallowJson (#56)

v1.5.1

13 Apr 22:11
Compare
Choose a tag to compare

<a name"1.5.1">

1.5.1 (2017-04-13)

Bug Fixes

  • Upgraded prettier and styles (d709d04e)

v1.5.0

22 Feb 12:04
Compare
Choose a tag to compare

<a name"1.5.0">

1.5.0 (2017-02-22)

Features

  • allow multiple nodes to be rendered to JSON for shallow, mount and render (#49) (0ae73511)

v1.4.6

21 Feb 09:54
Compare
Choose a tag to compare

<a name"1.4.6">

1.4.6 (2017-02-21)

Bug Fixes

  • Switch to XO codestyle (3549541e)
  • Replaced lodash.compact by another solution to keep 0 values (#46) (5ad7fd51)
  • Fixed render with children (#45) (95001b0b)
  • Update enzyme peer dependency to v2.7.1 (#43) (87e5613f)
  • renderToJson return null when a component returns null (#41) (6aabd9e1)

v1.4.5

15 Dec 09:10
Compare
Choose a tag to compare

<a name"1.4.5">

1.4.5 (2016-12-15)

Bug Fixes

  • mountToJson not rendering mixed children (#34) (4fcfbf3b)

v1.4.4

07 Dec 12:00
Compare
Choose a tag to compare

<a name"1.4.4">

1.4.4 (2016-12-07)

Bug Fixes

  • Additional check to avoid potential bug (0575adac)