Skip to content

Commit

Permalink
Updated the spec runner so that it returns a non-zero exit-code when …
Browse files Browse the repository at this point in the history
…Jasmine tests fail.
  • Loading branch information
dchambers committed Oct 8, 2014
1 parent 200ea1e commit 5bd5463
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions spec/node-spec-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,25 @@ var jn = require('jasmine-node');
var karmaServer = require('karma').server;
var path = require('path');

console.log('Test Install:');
function exitOnFail(hasFailed) {
if(hasFailed) {
process.exit(-1);
}
}

// TODO: find out how 'node-jasmine' allows you to get test result information so we can return a non-zero exit code
console.log('Test Install:');
jn.run({specFolders:['./spec/test-install'], captureExceptions:true, onComplete:function() {
exitOnFail(global.jasmineResult.fail);
console.log('');
console.log('Spec Tests:');

jn.run({specFolders:['./spec/test'], captureExceptions:true, onComplete:function() {
exitOnFail(global.jasmineResult.fail);
console.log('');
console.log('Project Euler:');

jn.run({specFolders:['./spec/project-euler'], captureExceptions:true, onComplete:function() {
exitOnFail(global.jasmineResult.fail);
console.log('');
console.log('Browser Tests:');

Expand Down

0 comments on commit 5bd5463

Please sign in to comment.