Skip to content

Commit a186750

Browse files
committed
chore: fix memory leak warnings
1 parent 263c1d5 commit a186750

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

setupTest.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,12 @@
33
process.env.CHOKIDAR_USEPOLLING = true;
44

55
jest.setTimeout(140000);
6+
7+
if (expect.getState().testPath.includes("test/e2e")) {
8+
afterEach(() => {
9+
// We add listeners to signals when creating a new Server instance, but have no cleanup method
10+
// So ensure they are removed after each run to prevent EventEmitter memory leak warnings
11+
process.removeAllListeners("SIGINT");
12+
process.removeAllListeners("SIGTERM");
13+
});
14+
}

0 commit comments

Comments
 (0)