diff options
Diffstat (limited to 'tests/testdata')
-rw-r--r-- | tests/testdata/node/rejection_handled_web_process.ts | 26 | ||||
-rw-r--r-- | tests/testdata/node/rejection_handled_web_process.ts.out | 6 |
2 files changed, 0 insertions, 32 deletions
diff --git a/tests/testdata/node/rejection_handled_web_process.ts b/tests/testdata/node/rejection_handled_web_process.ts deleted file mode 100644 index a5136ca3d..000000000 --- a/tests/testdata/node/rejection_handled_web_process.ts +++ /dev/null @@ -1,26 +0,0 @@ -import chalk from "npm:chalk"; -import process from "node:process"; - -console.log(chalk.red("Hello world!")); - -globalThis.addEventListener("unhandledrejection", (e) => { - console.log('globalThis.addEventListener("unhandledrejection");'); - e.preventDefault(); -}); - -globalThis.addEventListener("rejectionhandled", (_) => { - console.log("Web rejectionhandled"); -}); - -process.on("rejectionHandled", (_) => { - console.log("Node rejectionHandled"); -}); - -const a = Promise.reject(1); -setTimeout(() => { - a.catch(() => console.log("Added catch handler to the promise")); -}, 100); - -setTimeout(() => { - console.log("Success"); -}, 1000); diff --git a/tests/testdata/node/rejection_handled_web_process.ts.out b/tests/testdata/node/rejection_handled_web_process.ts.out deleted file mode 100644 index e6fefede2..000000000 --- a/tests/testdata/node/rejection_handled_web_process.ts.out +++ /dev/null @@ -1,6 +0,0 @@ -Hello world! -globalThis.addEventListener("unhandledrejection"); -Added catch handler to the promise -Web rejectionhandled -Node rejectionHandled -Success |