Sha256: f5c0b4fc703f8997a151d24fbab910952a1438d31907f58214823556fa7d5286
Contents?: true
Size: 828 Bytes
Versions: 23
Compression:
Stored size: 828 Bytes
Contents
describe('events', () => { beforeEach(() => { mumuki.events.clear('foo'); }); it('is not called when it is not fired', () => { mumuki.events.on('foo', (e) => { fail(`should not be called, but got ${JSON.stringify(e)}`); }) }) it('is not called when it is fired but not enabled', () => { let fired = false; mumuki.events.on('foo', (e) => { fail(`should not be called, but got ${JSON.stringify(e)}`); fired = true; }) mumuki.events.fire('foo', 42); expect(fired).toBe(false); }) it('is called when it is fired and enabled', () => { let fired = false; mumuki.events.enable('foo'); mumuki.events.on('foo', (event) => { expect(event).toEqual(42); fired = true; }) mumuki.events.fire('foo', 42); expect(fired).toBe(true); }) })
Version data entries
23 entries across 23 versions & 1 rubygems