Skip to content

Commit 4daeda1

Browse files
log individual test results when in --debug mode
1 parent c1925db commit 4daeda1

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

grunt/config/webdriver-jasmine.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ exports.local = {
1616
}
1717
}
1818

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

2022
exports.saucelabs = {
2123
webdriver: {

test/lib/reportTestResults.browser.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
1+
console._log = console.log;
2+
console.log = function(message){
3+
console._log(message);
4+
postDataToURL({type:'log', message:message}, '/reportTestResults');
5+
}
6+
console._error = console.error;
7+
console.error = function(message){
8+
console._error(message);
9+
postDataToURL({type:'error', message:message}, '/reportTestResults');
10+
}
11+
112
;(function(env){
213
env.addReporter(new jasmine.JSReporter());
14+
if (location.search.substring(1).indexOf('debug') != -1){
15+
env.addReporter(new TAPReporter(console.log.bind(console)));
16+
}
317

418
function report(){
519
if (typeof jasmine.getJSReport != 'function') {

0 commit comments

Comments
 (0)