test: re-run the test suite on the minified file on travis

This commit is contained in:
Luca Greco 2017-02-08 01:00:31 +01:00 committed by Luca Greco
parent 9a38d923e9
commit 96cfb9c5c2
3 changed files with 7 additions and 4 deletions

View File

@ -6,7 +6,8 @@ node_js:
script:
- npm run build
- COVERAGE=y npm run test-coverage
- npm run test-coverage
- echo "RE-RUN all tests on the minified file" && npm run test-minified
after_script: npm run publish-coverage

View File

@ -43,9 +43,10 @@
},
"scripts": {
"build": "grunt",
"prepublish": "npm run build && npm run test",
"publish-coverage": "grunt coveralls",
"test": "mocha",
"test-coverage": "COVERAGE=y nyc mocha",
"publish-coverage": "grunt coveralls",
"prepublish": "npm run build && npm run test"
"test-minified": "TEST_MINIFIED_POLYFILL=1 mocha"
}
}

View File

@ -13,7 +13,8 @@ if (process.env.ENABLE_JSDOM_CONSOLE == "y") {
// Path to the browser-polyfill script, relative to the current work dir
// where mocha is executed.
const BROWSER_POLYFILL_PATH = "./dist/browser-polyfill.js";
const BROWSER_POLYFILL_PATH = process.env.TEST_MINIFIED_POLYFILL ?
"./dist/browser-polyfill.min.js" : "./dist/browser-polyfill.js";
// Create the jsdom window used to run the tests
const testDOMWindow = jsdom("", {virtualConsole}).defaultView;