mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
16 lines
317 B
TypeScript
16 lines
317 B
TypeScript
import { expect, test } from "bun:test";
|
|
import { runInNewContext } from "node:vm";
|
|
|
|
test("issue #9778", () => {
|
|
const code = `
|
|
process.on("poop", () => {
|
|
throw new Error("woopsie");
|
|
});
|
|
`;
|
|
|
|
runInNewContext(code, {
|
|
process,
|
|
});
|
|
expect(() => process.emit("poop")).toThrow("woopsie");
|
|
});
|