Moved status init of defaults in setup(). Fixes gruntjs/grunt-contrib-jasmine#50

This commit is contained in:
Nicolas Rakoto 2013-03-29 23:18:51 +01:00
parent ea5334ec7e
commit 2069f109e2

View File

@ -21,15 +21,7 @@ module.exports = function(grunt) {
var junitTemplate = __dirname + '/jasmine/templates/JUnit.tmpl'; var junitTemplate = __dirname + '/jasmine/templates/JUnit.tmpl';
var status = { var status = {};
specs : 0,
failed : 0,
passed : 0,
total : 0,
skipped : 0,
duration : 0,
log : ''
};
grunt.registerMultiTask('jasmine', 'Run jasmine specs headlessly through PhantomJS.', function() { grunt.registerMultiTask('jasmine', 'Run jasmine specs headlessly through PhantomJS.', function() {
@ -116,6 +108,16 @@ module.exports = function(grunt) {
function setup(options) { function setup(options) {
var thisRun = {}; var thisRun = {};
status = {
specs : 0,
failed : 0,
passed : 0,
total : 0,
skipped : 0,
duration : 0,
log : ''
};
phantomjs.on('fail.timeout',function(){ phantomjs.on('fail.timeout',function(){
grunt.log.writeln(); grunt.log.writeln();
grunt.warn('PhantomJS timed out, possibly due to an unfinished async spec.', 90); grunt.warn('PhantomJS timed out, possibly due to an unfinished async spec.', 90);
@ -242,4 +244,4 @@ module.exports = function(grunt) {
}); });
} }
}; };