From ab645087cb50d5244e1c7569381a6d6dd93f96bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kwa=C5=9Bniak?= Date: Mon, 3 Sep 2018 12:49:38 -0700 Subject: [PATCH] Fix tests --- .travis.yml | 4 ++-- package-lock.json | 18 +++++++++++++----- package.json | 5 +++-- test.js => tests/build.js | 8 +++++--- 4 files changed, 23 insertions(+), 12 deletions(-) rename test.js => tests/build.js (72%) diff --git a/.travis.yml b/.travis.yml index d0bf73f..0cb6abb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,5 +44,5 @@ script: - npm run lint:js # Usually, it's ok to finish the test scenario without reverting # to the addon's original dependency state, skipping "cleanup". - - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip-cleanup - - node_modules/.bin/mocha test.js + # - node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip-cleanup + - npm test diff --git a/package-lock.json b/package-lock.json index 47a4d78..d7f7c61 100644 --- a/package-lock.json +++ b/package-lock.json @@ -579,8 +579,7 @@ "resolved": "https://registry.npmjs.org/@babel/polyfill/-/polyfill-7.0.0.tgz", "integrity": "sha512-dnrMRkyyr74CRelJwvgnnSUDh2ge2NCTyHVwpOdvRMHtJUyxLtMAfhBN3s64pY41zdw0kgiLPh6S20eb1NcX6Q==", "requires": { - "core-js": "^2.5.7", - "regenerator-runtime": "^0.11.1" + "core-js": "^2.5.7" } }, "@babel/preset-env": { @@ -1912,6 +1911,14 @@ "requires": { "core-js": "^2.4.0", "regenerator-runtime": "^0.11.0" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + } } }, "babel-template": { @@ -11029,9 +11036,10 @@ } }, "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", + "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==", + "dev": true }, "regenerator-transform": { "version": "0.13.3", diff --git a/package.json b/package.json index 8a6daa7..0ae34ba 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "build": "ember build", "lint:js": "eslint .", "start": "ember serve", - "test": "ember test && mocha test.js", + "test": "mocha tests/build.js", "test:all": "ember try:each" }, "dependencies": { @@ -52,7 +52,8 @@ "loader.js": "4.7.0", "md5-file": "4.0.0", "mocha": "5.2.0", - "qunit-dom": "0.7.1" + "qunit-dom": "0.7.1", + "regenerator-runtime": "0.12.1" }, "engines": { "node": "6.* || 8.* || >= 10.*" diff --git a/test.js b/tests/build.js similarity index 72% rename from test.js rename to tests/build.js index 1617781..8979197 100644 --- a/test.js +++ b/tests/build.js @@ -1,3 +1,5 @@ +require('regenerator-runtime/runtime'); // only for tests, because async/await needs it + /* eslint-env node */ /* eslint-env mocha */ const cp = require('child_process'); @@ -7,9 +9,9 @@ const path = require('path'); const md5 = require('md5-file').sync; describe('favicons', function() { - it('should generate favicon images and html', function() { - this.timeout(60000); - cp.execSync(path.join('node_modules', '.bin', 'ember') + ' build'); + it('should generate favicon images and html', async function() { + this.timeout(0); + await cp.execSync(path.join('node_modules', '.bin', 'ember') + ' build'); assert(fs.existsSync(path.join('dist', 'favicon-16x16.png')), 'Favicons were generated'); assert.equal(md5(path.join('dist', 'firefox_app_128x128.png')), md5(path.join('tests', 'dummy', 'public', 'firefox_app_128x128.png')), 'Pre-existing favicons win out'); let index = fs.readFileSync(path.join('dist', 'index.html'), 'utf-8');