diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2024-03-20 11:20:18 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-20 11:20:18 +0530 |
commit | 724cdcec7bcee49fdd0f34b35fbfbbf556c7eda3 (patch) | |
tree | 5761cc212e807abef7b1619bbee203dcdef42d7d /tests | |
parent | 5b2f689f085fea8ff52f296c94072a1fb29dd054 (diff) |
fix(ext/node): implement EventEmitterAsyncResource (#22994)
Fixes #22729
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit_node/events_test.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/unit_node/events_test.ts b/tests/unit_node/events_test.ts index 13abf5f79..1fc7ad1e3 100644 --- a/tests/unit_node/events_test.ts +++ b/tests/unit_node/events_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { EventEmitter } from "node:events"; +import events, { EventEmitter } from "node:events"; EventEmitter.captureRejections = true; @@ -25,3 +25,12 @@ Deno.test("regression #20441", async () => { ee.emit("foo"); await promise; }); + +Deno.test("eventemitter async resource", () => { + // @ts-ignore: @types/node is outdated + class Foo extends events.EventEmitterAsyncResource {} + + const foo = new Foo(); + // @ts-ignore: @types/node is outdated + foo.emit("bar"); +}); |