We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4cce9cb commit 0cce8faCopy full SHA for 0cce8fa
test/index_test.ts
@@ -150,6 +150,17 @@ describe('mitt#', () => {
150
inst.off('foo', foo);
151
expect(events.get('foo')).to.deep.equal([]);
152
});
153
+
154
+ it('off("type") should remove all handlers of the given type', () => {
155
+ inst.on('foo', () => {});
156
157
+ inst.on('bar', () => {});
158
+ inst.off('foo');
159
+ expect(events.get('foo')).to.deep.equal([]);
160
+ expect(events.get('bar')).to.have.length(1);
161
+ inst.off('bar');
162
+ expect(events.get('bar')).to.deep.equal([]);
163
+ });
164
165
166
describe('emit()', () => {
0 commit comments