Skip to content

Commit

Permalink
Added a test
Browse files Browse the repository at this point in the history
  • Loading branch information
yvann committed Nov 7, 2023
1 parent 79fab0a commit 0235b11
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,15 @@ describe('EventEmitter', () => {
Promise.all([ee.throwOnError(), ee.emit('error', new Error('KO'))]),
).rejects.toThrowError('KO');

// handles signal
{
const ac = new AbortController();

await expect(
Promise.all([ee.throwOnError(ac.signal), (() => ac.abort())()]),
).resolves.toEqual([undefined, undefined]);
}

expect(ee.eventNames()).toEqual([]);
});

Expand Down

0 comments on commit 0235b11

Please sign in to comment.