aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlexander Gudulin <[email protected]>2017-01-16 22:05:05 +0100
committerAlexander Gudulin <[email protected]>2017-01-16 22:05:05 +0100
commit3fb2dc21223b414afc6f1fa3c8bc8fc7de2d48d5 (patch)
tree61907d336e05204720049872ef746eb1c9f2d5fa /test
parent0d51fe34ce1b1ccf7c99726d9c577a40ea840da7 (diff)
Fixes #9: use Object.create(null) over {}
Diffstat (limited to 'test')
-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 = () => {};