You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Making Differencify compatible with differencify-jest-reporter
- Save the captured image from the current test run to test the report path by default
Copy file name to clipboardexpand all lines: README.md
+40-1
Original file line number
Diff line number
Diff line change
@@ -111,6 +111,44 @@ As you can see, you don't need to return `result` as `toMatchSnapshot` will auto
111
111
112
112
Same way as Jest [snapshots testing](http://facebook.github.io/jest/docs/en/snapshot-testing.html), to update the snapshots, run jest with `--updateSnapshot` or `-u` argument.
113
113
114
+
## Jest reporter
115
+
116
+
You can generate an index document of the saved images by using the differencify jest reporter.
117
+
118
+
```bash
119
+
$ npm i -D differencify-jest-reporter
120
+
```
121
+
122
+
Enable the reporter in your jest config:
123
+
124
+
```
125
+
module.exports = {
126
+
reporters: [
127
+
'default', // keep the default reporter
128
+
[
129
+
'differencify-jest-reporter',
130
+
{
131
+
debug: true,
132
+
reportPath: 'differencify_reports', // relative to root of project
133
+
reportTypes: {
134
+
html: 'index.html',
135
+
json: 'index.json',
136
+
},
137
+
},
138
+
],
139
+
],
140
+
};
141
+
```
142
+
143
+
Alternatively, enable the reporter with the cli:
144
+
145
+
```
146
+
jest --reporters default differencify-jest-reporter
If you are using other test frameworks you can still validate your tests. Differencify will return `true` or `false` by the end of execution. This could be used to assert on. look at the [example](https://github.com/NimaSoroush/differencify#validate-your-changes)
116
154
@@ -159,7 +197,8 @@ See [API.md](API.md) for full list of API calls
0 commit comments