log individual test results when in --debug mode

This commit is contained in:
Thomas Aylott 2013-11-11 15:13:46 -05:00
parent c1925db067
commit 4daeda1490
2 changed files with 16 additions and 0 deletions

View File

@ -16,6 +16,8 @@ exports.local = {
}
}
if (grunt.option('debug')) exports.local.url += '?debug=' + grunt.option('debug');
exports.saucelabs = {
webdriver: {

View File

@ -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') {