When I run a suite of jasmine tests from the command line I'd like some type of fail fast option so it stops at the first assertion error
Does anything like this exist today?
When I run a suite of jasmine tests from the command line I'd like some type of fail fast option so it stops at the first assertion error
Does anything like this exist today?
You can do it manually / artificially through a custom reporter. They seem to be working on that feature but issue is still open. Right now this is what I'm doing in jasmine-node:
function installExitOnFail(runner)
{
var SpecReporter = require('jasmine-spec-reporter')
var exitOnFailReporter = new SpecReporter({displayStacktrace: true});
var specDone = exitOnFailReporter.specDone
exitOnFailReporter.specDone = function(result)
{
if(result.status === 'failed')
{
console.log(outpcolors.red('\nFailed test: ' + result.fullName +
'\nReason: '+result.failedExpectations[0].message) +
'\n' + result.failedExpectations[0].stackut);
process.exit(1);
}
else
{
specDone.apply(exitOnFailReporter, arguments)
}
};
runner.addReporter(exitOnFailReporter);
}
var jasmineRunner = new require('jasmine')();
installExitOnFail(jasmineRunner);
jasmine.DEFAULT_TIMEOUT_INTERVAL = 99999999;
jasmineRunner.specFiles = [your specs files....];
jasmineRunner.execute();