diff options
author | 2022-06-22 06:49:50 -0700 | |
---|---|---|
committer | 2022-06-22 06:56:47 -0700 | |
commit | fa2d6a0d4019e02b79c4727957269b6e60346f91 (patch) | |
tree | 21a041b593cb7a25aea7f159e177b8fb431274a5 | |
parent | d1ae1771ebf1056187029e643d1b318fe564cc8f (diff) | |
download | bun-fa2d6a0d4019e02b79c4727957269b6e60346f91.tar.gz bun-fa2d6a0d4019e02b79c4727957269b6e60346f91.tar.zst bun-fa2d6a0d4019e02b79c4727957269b6e60346f91.zip |
Add a simple test for EventEmitter
Diffstat (limited to '')
-rw-r--r-- | integration/bunjs-only-snippets/node-builtins.test.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/integration/bunjs-only-snippets/node-builtins.test.js b/integration/bunjs-only-snippets/node-builtins.test.js new file mode 100644 index 000000000..df31c64fc --- /dev/null +++ b/integration/bunjs-only-snippets/node-builtins.test.js @@ -0,0 +1,16 @@ +import { describe, it, expect } from "bun:test"; + +import { EventEmitter } from "events"; + +describe("EventEmitter", () => { + it("should emit events", () => { + const emitter = new EventEmitter(); + var called = false; + const listener = () => { + called = true; + }; + emitter.on("test", listener); + emitter.emit("test"); + expect(called).toBe(true); + }); +}); |