1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-23 15:49:44 -05:00
denoland-deno/tests/specs/node/next_tick_uncaught_exception/main.ts

14 lines
289 B
TypeScript
Raw Normal View History

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;
});