Skip to content
Myr

add editorconfig, fix original identation

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by tunnckoCore · committed by tunnckoCore · parent 8b4f2de · Browse files · 4 files+80 added−71 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+80 added−71 removed

  • tests:+17 added−17 removed
  • other:+63 added−54 removed

4 files+80 added−71 removed

modified:src/index.js+48 added-48 removed
modified:test/index.js+17 added-17 removed
11 unmodified lines
12 let events, inst;1314 beforeEach( () => {15 inst = mitt();16 events = inst.all;16 events = inst.all;17 });1819 describe('on()', () => {20 it('should be a function', () => {
13 unmodified lines
34 let foo = () => {};35 inst.on('constructor', foo);3637 expect(events).to.have.property('constructor').that.deep.equals(new Set([foo]));38 });38 });3940 it('should append handler for existing type', () => {41 let foo = () => {};42 let bar = () => {};
53 unmodified lines
96 .that.is.a('function');97 });9899 it('should invoke handler for type', () => {100 let event = { a: 'b' };100 let event = { a: 'b' };101102 inst.on('foo', (one, two) => {103 expect(one).to.deep.equal(event);104 expect(two).to.be.an('undefined');105 });103 expect(one).to.deep.equal(event);104 expect(two).to.be.an('undefined');105 });106107 inst.emit('foo', event);108 });109110 it('should invoke handler with multiple arguments', () => {111 inst.on('foo', (aaa, bbb, ccc) => {112 expect(aaa).to.be.equal(111);113 expect(bbb).to.be.equal(222);114 expect(ccc).to.be.equal(333);115 });116 inst.emit('foo', 111, 222, 333);117 });110 it('should invoke handler with multiple arguments', () => {111 inst.on('foo', (aaa, bbb, ccc) => {112 expect(aaa).to.be.equal(111);113 expect(bbb).to.be.equal(222);114 expect(ccc).to.be.equal(333);115 });116 inst.emit('foo', 111, 222, 333);117 });118119 it('should ignore case', () => {120 let foo = spy(),121 num = 123;
1 unmodified line
123124 inst.emit('FOO', num);125 inst.emit('Foo', num);126127 let args = foo.args[0];127 let args = foo.args[0];128129 expect(foo).to.have.been.calledTwice;130 expect(args).to.be.deep.equal([num, undefined, undefined]);130 expect(args).to.be.deep.equal([num, undefined, undefined]);131 });132133 it('should invoke * handlers', () => {134 let star = spy(),
2 unmodified lines
137138 inst.emit('foo', aa);139 inst.emit('bar', aa);140141 let args1 = star.args[0],141 let args1 = star.args[0],142 args2 = star.args[1];143144 expect(star).to.have.been.calledTwice;145 expect(args1).to.deep.equal(['foo', aa, undefined, undefined]);
4 unmodified lines
added:.editorconfig+9 added
1root = true23[*]4indent_style = tab5indent_size = 46charset = utf-87trim_trailing_whitespace = true8insert_final_newline = true9
modified:example.js+6 added-6 removed