Skip to content

Commit 8cc8f70

Browse files
maraisrthymikee
authored andcommitted
feat: Simpler integration with the new setupFilesAfterEnv jest feature (#87)
* feat: Simpler integration with the new setupFilesAfterEnv jest feature * docs: Talk about using the extend-expect import
1 parent 8f7ecf3 commit 8cc8f70

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ test('snapshot difference between 2 React components state', () => {
5454
});
5555
```
5656

57+
... alternatively import it once, for instance in your [tests setup file](https://jestjs.io/docs/en/configuration.html#setupfilesafterenv-array):
58+
59+
```js
60+
require('snapshot-diff/extend-expect');
61+
```
62+
5763
Produced snapshot:
5864

5965
```diff

extend-expect.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const { toMatchDiffSnapshot } = require('./build/');
2+
3+
expect.extend({ toMatchDiffSnapshot });

0 commit comments

Comments
 (0)