aboutsummaryrefslogtreecommitdiff
path: root/test/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/index.js')
-rw-r--r--test/index.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/index.js b/test/index.js
index 8055544..4efa75e 100644
--- a/test/index.js
+++ b/test/index.js
@@ -14,7 +14,7 @@ describe('mitt', () => {
let events, inst;
beforeEach( () => {
- events = {};
+ events = Object.create(null);
inst = mitt(events);
});
@@ -32,6 +32,13 @@ describe('mitt', () => {
expect(events).to.have.property('foo').that.deep.equals([foo]);
});
+ it('should register handlers for any type strings', () => {
+ let foo = () => {};
+ inst.on('constructor', foo);
+
+ expect(events).to.have.property('constructor').that.deep.equals([foo]);
+ });
+
it('should append handler for existing type', () => {
let foo = () => {};
let bar = () => {};