Skip to content

Commit 95b10fa

Browse files
committed
Add mocha config file to increase timeouts for tests
1 parent 14d686c commit 95b10fa

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"prettier": "npm run prettier:base -- --write",
6767
"prettier:check": "npm run prettier:base -- --check",
6868
"ts:check": "tsc --noEmit",
69-
"test": "ts-mocha --paths test/**/*.test.ts",
69+
"test": "ts-mocha --paths test/**/*.test.ts --config test/.mocharc.js",
7070
"ncu": "ncu -u"
7171
},
7272
"files": [

test/.mocharc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/** @type import("mocha").MochaOptions */
2+
const mochaConfig = {
3+
timeout: 30000,
4+
};
5+
6+
module.exports = mochaConfig;

test/clients.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,7 @@ describe("client shared functionality", function () {
100100
});
101101

102102
it("can do truly blocking read", async function () {
103-
// Slow because child process needs to run TS code on the fly
104-
this.timeout(10_000);
105-
103+
// Note: Slow because child process needs to transpile TS code
106104
const testString = "Hello worker thread!";
107105
const newConnection = testing.echo.events.newConnection.once();
108106
const sentDataPromise = testing.echo.events.sentData.once();

test/utils/tester.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { SocketBase } from "../../lib";
44
import { permutations } from "./permutations";
55
import { badArg } from "./bad-arg";
66

7-
mocha.timeout(30_000);
8-
97
type Writeable<T> = { -readonly [P in keyof T]: T[P] };
108

119
let nextPort = 50_000;

0 commit comments

Comments
 (0)