Skip to content

Commit

Permalink
log individual test results when in --debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
subtleGradient committed Nov 13, 2013
1 parent c1925db commit 4daeda1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions grunt/config/webdriver-jasmine.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ exports.local = {
}
}

if (grunt.option('debug')) exports.local.url += '?debug=' + grunt.option('debug');


exports.saucelabs = {
webdriver: {
Expand Down
14 changes: 14 additions & 0 deletions test/lib/reportTestResults.browser.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
console._log = console.log;
console.log = function(message){
console._log(message);
postDataToURL({type:'log', message:message}, '/reportTestResults');
}
console._error = console.error;
console.error = function(message){
console._error(message);
postDataToURL({type:'error', message:message}, '/reportTestResults');
}

;(function(env){
env.addReporter(new jasmine.JSReporter());
if (location.search.substring(1).indexOf('debug') != -1){
env.addReporter(new TAPReporter(console.log.bind(console)));
}

function report(){
if (typeof jasmine.getJSReport != 'function') {
Expand Down

0 comments on commit 4daeda1

Please sign in to comment.