Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
add event emitter once test case
Browse files Browse the repository at this point in the history
  • Loading branch information
JiaLiPassion committed Nov 9, 2016
1 parent da482b9 commit 4dabc6f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/node/events.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,11 @@ describe('nodejs EventEmitter', () => {
expect(emitter.listeners('test').length).toEqual(0);
});
});
it ('should remove once listener properly', () => {
zoneA.run(() => {
emitter.once('test', shouldNotRun);
emitter.removeListener('test', shouldNotRun);
emitter.emit('test');
});
});
});

0 comments on commit 4dabc6f

Please sign in to comment.