diff --git a/.travis.yml b/.travis.yml index 53fce10..77f1e94 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/package.json b/package.json index 3abb325..ad0e0ce 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/test/setup.js b/test/setup.js index de6055c..43dec4c 100644 --- a/test/setup.js +++ b/test/setup.js @@ -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;