Skip to content

Commit

Permalink
Node.js compat for test
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Dec 11, 2023
1 parent fb266a9 commit 39c9102
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/babel-core/test/async.js
Expand Up @@ -312,7 +312,7 @@ describe("asynchronicity", () => {
process.chdir("unknown-preset");
const handler = jest.fn();

process.on("unhandledRejection", handler);
process.addListener("unhandledRejection", handler);

await babel.loadPartialConfigAsync().catch(() => {});

Expand All @@ -321,7 +321,7 @@ describe("asynchronicity", () => {
// be triggered, it would have already happened.
await new Promise(r => setTimeout(r, 0));

process.off("unhandledRejection", handler);
process.removeListener("unhandledRejection", handler);

expect(handler).not.toHaveBeenCalled();
});
Expand Down

0 comments on commit 39c9102

Please sign in to comment.