Skip to content

Commit c918d4e

Browse files
committed
minor fix to report stuck tests
1 parent a978dc6 commit c918d4e

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

lib/_patch/qunit-plugin.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,27 @@
33
(function(){
44

55
var failedAssertions = [];
6-
var options, currentModule, currentTest, status;
6+
var options, currentModule, currentTest, setTimeoutVariable;
7+
var pendingTest = {};
8+
9+
var testTimeout = function() {
10+
var error = {
11+
testName: currentTest, message: "Stuck on this test for 60 sec."
12+
}
13+
14+
BrowserStack.post('/_progress', {tracebacks: [error]}, function(){});
15+
}
16+
17+
QUnit.testDone(function( details ) {
18+
var ct = details.module + " - " + details.name;
19+
clearTimeout(pendingTest[ct]);
20+
});
721

822
QUnit.testStart(function( details ) {
923
currentTest = details.module + " - " + details.name;
24+
pendingTest[currentTest] = setTimeout(function(){
25+
testTimeout(currentTest);
26+
}, 60000);
1027
});
1128

1229
QUnit.log(function( details ) {

0 commit comments

Comments
 (0)