diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/index.test.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/index.test.ts b/src/index.test.ts index af07805..eca7fbb 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -81,6 +81,15 @@ describe('nitt#', () => { inst.emit('foo', 1); expect(events.foo).toHaveLength(0); }); + + it('should not allow to remove a once handler', () => { + let foo = jest.fn(); + inst.once('foo', foo); + + expect(events.foo).toHaveLength(1); + inst.off('foo', foo); + expect(events.foo).toHaveLength(1); + }); }); describe('when()', () => { |
