mirror of
https://github.com/denoland/deno.git
synced 2024-11-25 15:29:32 -05:00
7b02f2aba6
Fixes flakiness for rejection handled tests on Windows (7 failures in the past day).
17 lines
468 B
TypeScript
17 lines
468 B
TypeScript
window.addEventListener("unhandledrejection", (event) => {
|
|
console.log("unhandledrejection", event.reason, event.promise);
|
|
event.preventDefault();
|
|
});
|
|
|
|
window.addEventListener("rejectionhandled", (event) => {
|
|
console.log("rejectionhandled", event.reason, event.promise);
|
|
});
|
|
|
|
const a = Promise.reject(1);
|
|
setTimeout(async () => {
|
|
a.catch(() => console.log("Added catch handler to the promise"));
|
|
}, 10);
|
|
|
|
setTimeout(() => {
|
|
console.log("Success");
|
|
}, 1000);
|