Skip to content

Commit 9fe2b0a

Browse files
committed
Fix microsoft#154 Mocha unit tests should timeout @ 2sec
- set default timeout to 2 seconds when the debugger is not attached
1 parent a35e215 commit 9fe2b0a

File tree

1 file changed

+9
-2
lines changed
  • Nodejs/Product/Nodejs/TestFrameworks/mocha

1 file changed

+9
-2
lines changed

Nodejs/Product/Nodejs/TestFrameworks/mocha/mocha.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,15 @@ var run_tests = function (testName, testFile, workingFolder, projectFolder) {
5555

5656
var mocha = new Mocha();
5757
mocha.ui('tdd');
58-
//set timeout to 10 minutes, because the default of 2 sec might be too short (TODO: make it configurable)
59-
mocha.suite.timeout(600000);
58+
59+
//set timeout to 10 minutes, because the default of 2 sec is too short for debugging scenarios
60+
// TODO: make it configurable
61+
if (typeof (v8debug) === 'object') {
62+
mocha.suite.timeout(600000);
63+
} else {
64+
mocha.suite.timeout(2000)
65+
}
66+
6067
if (testName) {
6168
mocha.grep(testName);
6269
}

0 commit comments

Comments
 (0)