summaryrefslogtreecommitdiff
path: root/tests/specs/node/next_tick_uncaught_exception/main.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/specs/node/next_tick_uncaught_exception/main.ts')
-rw-r--r--tests/specs/node/next_tick_uncaught_exception/main.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/specs/node/next_tick_uncaught_exception/main.ts b/tests/specs/node/next_tick_uncaught_exception/main.ts
new file mode 100644
index 000000000..2679d3d54
--- /dev/null
+++ b/tests/specs/node/next_tick_uncaught_exception/main.ts
@@ -0,0 +1,13 @@
+import process from "node:process";
+import { strictEqual } from "node:assert";
+
+const error = new Error("thrown from next tick");
+
+process.on("uncaughtException", (caught) => {
+ strictEqual(caught, error);
+ console.log("caught", caught);
+});
+
+process.nextTick(() => {
+ throw error;
+});