Skip to content

Commit

Permalink
chore: prepare for adding configurations options (#18)
Browse files Browse the repository at this point in the history
This patch is first phase for adding an option to configure your matcher (with appName, and later on use batches)
  • Loading branch information
yanivefraim authored Jun 25, 2018
1 parent e5e3439 commit 1ee7613
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@ A simple Jest or Chai matcher to compare screenshots, using [Applitools Eyes](ht
},
```
In case you have several custom matchers in your project / you need `setupTestFrameworkScriptFile` for other configurations, just use:
```js
"jest": {
"setupTestFrameworkScriptFile": "<rootDir>/setupTestFrameworkScriptFile.js"
},
```
Inside `setupTestFrameworkScriptFile.js` you can then:
```js
require('match-screenshot/jest');
```
##### Chai
```js
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"jest": {
"preset": "jest-puppeteer",
"setupTestFrameworkScriptFile": "<rootDir>/lib/jest.js"
"setupTestFrameworkScriptFile": "<rootDir>/setupTestFrameworkScriptFile.js"
},
"devDependencies": {
"chai": "^4.1.2",
Expand Down
1 change: 1 addition & 0 deletions setupTestFrameworkScriptFile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('./lib/jest.js');
2 changes: 1 addition & 1 deletion tests/__fixtures__/conf.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"preset": "jest-puppeteer",
"testMatch": [ "**/tests/__fixtures__/*.jest.js"],
"setupTestFrameworkScriptFile": "<rootDir>/../../lib/jest"
"setupTestFrameworkScriptFile": "<rootDir>/setupTestFrameworkScriptFile.js"
}
1 change: 1 addition & 0 deletions tests/__fixtures__/setupTestFrameworkScriptFile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('../../lib/jest');

0 comments on commit 1ee7613

Please sign in to comment.