aboutsummaryrefslogtreecommitdiff
path: root/test/js
diff options
context:
space:
mode:
authorGravatar Derrick Farris <mr.dcfarris@gmail.com> 2023-03-27 19:41:11 -0500
committerGravatar Derrick Farris <mr.dcfarris@gmail.com> 2023-03-27 19:42:38 -0500
commit9a10e9ab5398fa2454439c5a145e1134aef9cbd9 (patch)
treee8be919f5bfd4affc915c378a825f746d731d689 /test/js
parent319efe9c7b248e899f75aeca99875542b96a0a2e (diff)
downloadbun-derrick/fix/event-emitter-emit-throw-native.tar.gz
bun-derrick/fix/event-emitter-emit-throw-native.tar.zst
bun-derrick/fix/event-emitter-emit-throw-native.zip
wip(node:events): fix emit when no `error` listener attached to EEderrick/fix/event-emitter-emit-throw-native
Note: Deprecated branch, rewriting `EE.prototype.emit` in JS
Diffstat (limited to 'test/js')
-rw-r--r--test/js/node/events/event-emitter.test.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/js/node/events/event-emitter.test.ts b/test/js/node/events/event-emitter.test.ts
index 401ccf605..9f049e11e 100644
--- a/test/js/node/events/event-emitter.test.ts
+++ b/test/js/node/events/event-emitter.test.ts
@@ -162,3 +162,8 @@ test("EventEmitter GCs", async () => {
await expectMaxObjectTypeCount(expect, "EventEmitter", startCount);
});
+
+test("EventEmitter error without listener", () => {
+ var myEmitter = new EventEmitter();
+ expect(() => myEmitter.emit("error", new Error("whoops"))).toThrow("whoops");
+});