Skip to content

Commit

Permalink
fix(tests): return error codes if we have
Browse files Browse the repository at this point in the history
  • Loading branch information
balthazar committed Apr 26, 2015
1 parent 68ce44e commit 230dd87
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions app/templates/tasks/test.js(hasTests)
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ function testServer (done) {
gulp.src('server/**/*.spec.js', { read: false })
.pipe(plumber())
.pipe(mocha({ reporter: 'spec' }))
.once('end', function () {
done();
});<% } else { %>
.once('error', function () { done(1); })
.once('end', function () { done(0); });<% } else { %>
done();
<% } %>
}
Expand All @@ -59,7 +58,7 @@ function testClient (done) {
<% if (filters.karma) { %>
karma.start({
configFile: __dirname + '/../karma.conf.js'
}, function () { done(); });<% } else { %>
}, done);<% } else { %>
done();
<% } %>
}
Expand All @@ -70,15 +69,16 @@ exports.test = function (done) {
if (arg === 'client') {
return testClient(done);
} else if (arg === 'server') {
return testServer(function () {
done();
process.exit();
return testServer(function (code) {
done(code);
process.exit(code);
});
} else if (arg === false) {
return testClient(function () {
testServer(function () {
done();
process.exit();
return testClient(function (code) {
if (code) { return done(code); }
testServer(function (code) {
done(code);
process.exit(code);
});
});
} else {
Expand Down

0 comments on commit 230dd87

Please sign in to comment.