summaryrefslogtreecommitdiff
path: root/cli/tests/integration/node_unit_tests.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-01-12 23:10:42 +0100
committerGitHub <noreply@github.com>2024-01-12 22:10:42 +0000
commit7471587d29096a8de95a530f2132214ab9c08afa (patch)
treed9de4d8e894f7c744c75029898bc1fdd850a758a /cli/tests/integration/node_unit_tests.rs
parent288774c5eda35c27db21526bbcc94488c534137c (diff)
feat: "rejectionhandled" Web event and "rejectionHandled" Node event (#21875)
This commit adds support for "rejectionhandled" Web Event and "rejectionHandled" Node event. ```js import process from "node:process"; process.on("rejectionHandled", (promise) => { console.log("rejectionHandled", reason, promise); }); window.addEventListener("rejectionhandled", (event) => { console.log("rejectionhandled", event.reason, event.promise); }); ``` --------- Co-authored-by: Matt Mastracci <matthew@mastracci.com>
Diffstat (limited to 'cli/tests/integration/node_unit_tests.rs')
-rw-r--r--cli/tests/integration/node_unit_tests.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/cli/tests/integration/node_unit_tests.rs b/cli/tests/integration/node_unit_tests.rs
index 273066b09..351bf1eec 100644
--- a/cli/tests/integration/node_unit_tests.rs
+++ b/cli/tests/integration/node_unit_tests.rs
@@ -193,3 +193,12 @@ itest!(unhandled_rejection_web_process {
envs: env_vars_for_npm_tests(),
http_server: true,
});
+
+// Ensure that Web `onrejectionhandled` is fired before
+// Node's `process.on('rejectionHandled')`.
+itest!(rejection_handled_web_process {
+ args: "run -A node/rejection_handled_web_process.ts",
+ output: "node/rejection_handled_web_process.ts.out",
+ envs: env_vars_for_npm_tests(),
+ http_server: true,
+});