|
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 |
2 | 3 | (function(){
|
3 | 4 |
|
4 |
| - var striderErrors = [] |
5 |
| - , i = 0; |
| 5 | + var failedAssertions = []; |
| 6 | + var options, currentModule, currentTest, status; |
6 | 7 |
|
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; |
12 | 15 | }
|
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) |
21 | 20 | }
|
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 ) { |
26 | 26 | results.url = window.location.pathname;
|
27 | 27 | BrowserStack.post("/_report", results, function(){});
|
28 |
| - } |
| 28 | + }); |
| 29 | + |
29 | 30 | })();
|
30 |
| -// End Strider |
0 commit comments