testing: propoagate timeout option for unit tests

This commit is contained in:
Connor Peet 2021-04-29 12:19:36 -07:00
parent 8dcc489fa1
commit 24ea8408c3
No known key found for this signature in database
GPG key ID: CF8FD2EA0DBC61BD
2 changed files with 5 additions and 0 deletions

View file

@ -33,6 +33,7 @@ const optimist = require('optimist')
.describe('reporter', 'the mocha reporter').string('reporter').default('reporter', 'spec')
.describe('reporter-options', 'the mocha reporter options').string('reporter-options').default('reporter-options', '')
.describe('wait-server', 'port to connect to and wait before running tests')
.describe('timeout', 'timeout for tests')
.describe('tfs').string('tfs')
.describe('help', 'show the help').alias('help', 'h');

View file

@ -264,6 +264,10 @@ class IPCReporter {
}
function runTests(opts) {
// this *must* come before loadTests, or it doesn't work.
if (opts.timeout !== undefined) {
mocha.timeout(opts.timeout);
}
return loadTests(opts).then(() => {