Skip to content

Commit

Permalink
docs: Added a note about Jest 18 serializer configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
adriantoine committed Dec 15, 2016
1 parent eb14dcf commit 719e935
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,13 @@ If you are using [Jest v17.0.0 or higher](https://github.com/facebook/jest/blob/
Add this to your Jest configuration:

```js
"jest": {
"snapshotSerializers": ["<rootDir>/node_modules/enzyme-to-json/serializer"]
}
"snapshotSerializers": ["<rootDir>/node_modules/enzyme-to-json/serializer"]
```

If you use [Jest v18.0.0 or higher](https://github.com/facebook/jest/blob/master/CHANGELOG.md#jest-1800), you can use a shorthand:

```js
"snapshotSerializers": ["enzyme-to-json/serializer"]
```

Then you can use all of the above without having to include or use the `toJson` function! For example:
Expand Down

0 comments on commit 719e935

Please sign in to comment.