Fix: erroneous build product diffs

When resources/dist was removed or modified, the diff check erroneously
complained that the resources differed. This could be resolved by simply
running the tests again. This patch fixes the issue by leveraging Git to
do the diffs which eliminates the need for a temporary test-build
directory and has the side-effect of improving the grep experience for
the repo.

Change-Id: Idf33f4d52aab6a2907debf6a7d6c7be5c83d9ee6
This commit is contained in:
Stephen Niedzielski 2018-03-20 13:33:01 -05:00
parent 007cc5ab7c
commit 18f5c3d060

View file

@ -8,7 +8,7 @@
"test": "npm run check-built-assets && npm run test:dev && npm run doc",
"doc": "jsdoc -c jsdoc.json",
"doc:start": "nodemon --watch src --exec 'npm run doc'",
"check-built-assets": "echo 'CHECKING BUILD SOURCES ARE COMMITED' && rm -rf test-build && mv resources/dist test-build && npm run build && diff -x '*.map' -qr test-build resources/dist && rm -rf test-build",
"check-built-assets": "echo 'CHECKING BUILD SOURCES ARE COMMITTED OR STAGED' && rm -rf resources/dist/ && npm run build && git diff -q resources/dist",
"coverage": "istanbul cover node_modules/.bin/mw-node-qunit tests/node-qunit/*.js tests/node-qunit/**/*.js",
"precommit": "npm run test:dev && npm run build && git add resources/dist && bundlesize"
},