Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'keep-runner' of https://github.com/irium/grunt-contrib-…

…jasmine

* 'keep-runner' of https://github.com/irium/grunt-contrib-jasmine:
  Don't remover spec runner on fail.
  Added option 'keepRunner' to keep spec runner after specs execution.
  • Loading branch information...
commit bd81d3700950ec43ec8485f231edc784377a6c81 2 parents 380729b + d74c91c
@jsoverson authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 tasks/jasmine.js
View
10 tasks/jasmine.js
@@ -61,11 +61,15 @@ module.exports = function(grunt) {
var done = this.async();
phantomRunner(options, function(err,status) {
+ var success = !err && status.failed === 0;
+
if (err) grunt.log.error(err);
if (status.failed === 0) grunt.log.ok('0 failures');
else grunt.log.error(status.failed + ' failures');
+
+ options.keepRunner = options.keepRunner || !success;
teardown(options);
- done(!err && status.failed === 0);
+ done(success);
});
});
@@ -96,8 +100,8 @@ module.exports = function(grunt) {
}
function teardown(options) {
- if (fs.statSync(options.outfile).isFile()) fs.unlink(options.outfile);
- jasmine.cleanTemp();
+ if (!options.keepRunner && fs.statSync(options.outfile).isFile()) fs.unlink(options.outfile);
+ if (!options.keepRunner) jasmine.cleanTemp();
// Have to explicitly unregister nested wildcards. Need to file a bug for EventEmitter2
phantomjs.removeAllListeners('*');
Please sign in to comment.
Something went wrong with that request. Please try again.