Skip to content

Commit

Permalink
test: fix testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
bytemain committed Jan 16, 2024
1 parent 6bb85ec commit 48ea622
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/helper/event.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,15 @@ describe('event emitter types', () => {
const spy = jest.fn();
const spy2 = jest.fn();

emitter.on('test', spy);
emitter.on('foo', spy2);

expect(emitter.hasListener('test')).toBe(true);
const listeners = emitter.getListeners('test');
expect(listeners.length).toBe(1);

emitter.emit('test', 'hello', 'world');
expect(spy).toBeCalledWith('hello');
expect(spy).toBeCalledWith('hello', 'world');
emitter.off('test', spy);

const listeners2 = emitter.getListeners('test');
Expand Down

0 comments on commit 48ea622

Please sign in to comment.