Skip to content

Commit

Permalink
sauce bugfix: override reporter, ONLY report failures.
Browse files Browse the repository at this point in the history
this is a known bug on the sauce labs side. see the following issues (there are others too):

axemclion/grunt-saucelabs#168
axemclion/grunt-saucelabs#123
  • Loading branch information
nchase committed Feb 20, 2015
1 parent 0379dfb commit 2bd2925
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion spec/jasmine-jsreporter-script.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
(function() {
jasmine.getEnv().addReporter(new jasmine.JSReporter2()); //< for jsreporter
})();

var oldFunc = window.jasmine.getJSReport;

window.jasmine.getJSReport = function() {
var results = oldFunc();
return removePassing(results);
};

function removePassing(results) {
if (typeof results === "undefined") {
return false;
}

var suites = [];

for (var i = 0; i < results.length; i++) {
if (!results.suites[i].passed) {
suites.push(results.suites[i]);
}
}

results.suites = suites;

return results;
}
})();

0 comments on commit 2bd2925

Please sign in to comment.