Skip to content

Commit

Permalink
test: add puppeteer config and run in band
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverForeman authored and chrisprice committed Feb 3, 2020
1 parent a8cfb4b commit d6f3099
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
7 changes: 5 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ First the performance tests need baselining for the machine they are being run
on. Check out the code prior to the change under test and run -

```bash
npm run examples -- --updateSnapshot
HEADLESS=false EXECUTABLE_PATH="path_to_chrome\chrome.exe" npm run examples -- --updateSnapshot
```

At this stage the `*/__tests__/__snapshots__` files will have been updated
Expand All @@ -23,9 +23,12 @@ files with the visual output of the examples.
Check out the code containing the change under test and run -

```bash
npm run examples
HEADLESS=false EXECUTABLE_PATH="path_to_chrome\chrome.exe" npm run examples
```

Any errors at this stage should correlate with known changes to either the
performance or visual output of the examples (please don't ignore
non-determinism).

It is advised that the `HEADLESS` and `EXECUTABLE_PATH` environment variables
are set as puppeteer does not use the GPU in headless mode.
6 changes: 6 additions & 0 deletions examples/jest-puppeteer.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
launch: {
headless: process.env.HEADLESS !== 'false',
executablePath: process.env.EXECUTABLE_PATH
}
};
Binary file modified examples/series-webgl-bar/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/series-webgl-line/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"screenshots": "lerna run screenshots --stream --concurrency 1",
"start": "lerna run bundle && npm start --prefix ./packages/d3fc",
"commitlint": "commitlint --from HEAD~1 to HEAD --verbose",
"examples": "cd examples && npx jest"
"examples": "cd examples && npx jest --runInBand"
},
"husky": {
"hooks": {
Expand Down

0 comments on commit d6f3099

Please sign in to comment.