Add snapshot tests for SVG and JSON (#1557)

These tests should fail if something is accidentally changed that affects the SVG or JSON files. In the case of deliberate changes, we can update the snapshots.
This commit is contained in:
Paul Melnikow
2018-03-11 09:07:03 -07:00
committed by GitHub
parent d5fc786ad3
commit ae848f38f4
6 changed files with 247 additions and 33 deletions

View File

@@ -132,7 +132,14 @@ badge preview URIs with `maxAge` – run `LONG_CACHE=true npm run build`.
To analyze the frontend bundle, run `npm install webpack-bundle-analyzer` and
then `ANALYZE=true npm start`.
[Snapshot tests][] ensure we don't inadvertently make changes that affect the
SVG or JSON output. When deliberately changing the output, run
`SNAPSHOT_DRY=1 npm run test:js:server` to preview changes to the saved
snapshots, and `SNAPSHOT_UPDATE=1 npm run test:js:server` to update them.
[package manager]: https://nodejs.org/en/download/package-manager/
[snapshot tests]: https://glebbahmutov.com/blog/snapshot-testing/
Hosting your own server