Skip to content

Commit

Permalink
Fix travis not signaling an error when node tests fail
Browse files Browse the repository at this point in the history
  • Loading branch information
rejas committed Dec 18, 2019
1 parent 06c035c commit 0440d39
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 55 deletions.
7 changes: 4 additions & 3 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const directories = {
])
};

let failures = 0;

gulp.task('clean', () => {
return del([
'dist',
Expand Down Expand Up @@ -86,7 +88,6 @@ gulp.task('generate', (done) => {
});

gulp.task('mocha:browser', (done) => {
let failures = 0;
const options = {
reporter: 'dot',
timeout: 5000,
Expand Down Expand Up @@ -121,8 +122,8 @@ gulp.task('mocha:node', (done) => {
});

// Run the tests.
mocha.run(failures => {
process.exitCode = failures ? 1 : 0; // exit with non-zero status if there were failures
mocha.run(fails => {
failures += fails;
done();
});
});
Expand Down
100 changes: 50 additions & 50 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
},
"devDependencies": {
"@alrra/travis-scripts": "^3.0.1",
"@babel/core": "^7.7.4",
"@babel/preset-env": "^7.7.4",
"@babel/core": "^7.7.5",
"@babel/preset-env": "^7.7.6",
"@babel/register": "^7.7.4",
"auto-changelog": "^1.16.2",
"chai": "^4.2.0",
Expand Down

0 comments on commit 0440d39

Please sign in to comment.