Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Exelord committed Sep 3, 2018
1 parent 725969e commit ab64508
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 13 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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.*"
Expand Down
8 changes: 5 additions & 3 deletions test.js → tests/build.js
Original file line number Diff line number Diff line change
@@ -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');
Expand All @@ -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');
Expand Down

0 comments on commit ab64508

Please sign in to comment.