Skip to content

Commit

Permalink
fix: unref asyncTimeout; fixes open handle issue in jest
Browse files Browse the repository at this point in the history
  • Loading branch information
tsemerad authored Oct 10, 2023
1 parent bc56253 commit 0ee1485
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const addTimeout = async<T>(promise: Promise<T>, label: string, timeout: number)
const asyncTimeout = new Promise<void>((_, reject) => {
setTimeout(() => {
reject(new Error(`[pact-msw-adapter] ${label} timed out after ${timeout}ms`));
}, timeout);
}, timeout).unref();
});

return Promise.race([promise, asyncTimeout]);
Expand Down

0 comments on commit 0ee1485

Please sign in to comment.