Skip to content

Commit

Permalink
chore: fix memory leak warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Nov 8, 2021
1 parent 263c1d5 commit a186750
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions setupTest.js
Expand Up @@ -3,3 +3,12 @@
process.env.CHOKIDAR_USEPOLLING = true;

jest.setTimeout(140000);

if (expect.getState().testPath.includes("test/e2e")) {
afterEach(() => {
// We add listeners to signals when creating a new Server instance, but have no cleanup method
// So ensure they are removed after each run to prevent EventEmitter memory leak warnings
process.removeAllListeners("SIGINT");
process.removeAllListeners("SIGTERM");
});
}

0 comments on commit a186750

Please sign in to comment.