Skip to content

Commit a978dc6

Browse files
committed
fixing logging
1 parent b40923a commit a978dc6

File tree

2 files changed

+29
-28
lines changed

2 files changed

+29
-28
lines changed

lib/_patch/qunit-plugin.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
// Here begins strider-qunit extension plugin
1+
// For logging assertions on the console, here's what grunt-contrib-qunit uses:
2+
// https://github.com/gruntjs/grunt-contrib-qunit/blob/784597023e7235337ca9c0651aa45124a2d72341/tasks/qunit.js#L45
23
(function(){
34

4-
var striderErrors = []
5-
, i = 0;
5+
var failedAssertions = [];
6+
var options, currentModule, currentTest, status;
67

7-
QUnit.log = function(res){
8-
i++;
9-
if (!res || !res.result){
10-
// Failure:
11-
striderErrors.push(JSON.stringify(res));
8+
QUnit.testStart(function( details ) {
9+
currentTest = details.module + " - " + details.name;
10+
});
11+
12+
QUnit.log(function( details ) {
13+
if ( details.result ) {
14+
return;
1215
}
13-
if (i%50 == 0){
14-
var data = {
15-
tests_run: i
16-
, tracebacks: striderErrors
17-
, url : window.location.pathname
18-
}
19-
striderErrors = [];
20-
BrowserStack.post('/_progress', data, function(){});
16+
17+
var error = {
18+
actual: details.actual, expected: details.expected, message: details.message, source: details.source,
19+
testName: (details.module + ": " + details.name)
2120
}
22-
}
23-
24-
QUnit.done = function(results){
25-
results.tracebacks = striderErrors;
21+
22+
BrowserStack.post('/_progress', {tracebacks: [error]}, function(){});
23+
});
24+
25+
QUnit.done(function( results ) {
2626
results.url = window.location.pathname;
2727
BrowserStack.post("/_report", results, function(){});
28-
}
28+
});
29+
2930
})();
30-
// End Strider

lib/server.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,15 @@ exports.Server = function Server(bsClient, workers) {
104104

105105
var uuid = request.headers['x-worker-uuid'];
106106
var worker = workers[uuid];
107-
// console.log("Tests run:", query.tests_run);
108-
// if (query.tracebacks) {
109-
// query.tracebacks.forEach(function (traceback) {
110-
// console.log("Error:", traceback);
111-
// });
112-
// }
107+
//console.log("Tests run:", query.tests_run);
108+
if (query.tracebacks) {
109+
query.tracebacks.forEach(function (traceback) {
110+
console.log("Error:", traceback);
111+
});
112+
}
113113
response.end();
114114
},
115+
115116
"_report": function reportHandler(uri, body, request, response) {
116117
query = null;
117118
try {query = parseBody(body); }catch(e){}

0 commit comments

Comments
 (0)