Sha256: 1c44845e0bbd1031a6d6772146aaa04725a004d7d63f244fb322023193f7b3f0
Contents?: true
Size: 1.2 KB
Versions: 1
Compression:
Stored size: 1.2 KB
Contents
describe('dc event engine', function () { describe('event execution', function () { var engine, trigger; beforeEach(function () { engine = dc.events; trigger = jasmine.createSpy('trigger'); }); it('event can be dispatched immediately', function () { engine.trigger(trigger); expect(trigger).toHaveBeenCalled(); }); it('event can be dispatched with delay', function () { engine.trigger(trigger, 100); expect(trigger).not.toHaveBeenCalled(); jasmine.clock().tick(101); expect(trigger).toHaveBeenCalled(); }); it('multiple events dispatched with delay should be throttled', function () { var times = 0; var i = 0; var increment = function () { times++; }; while (i < 10) { engine.trigger(increment.bind(null), 10); i++; } jasmine.clock().tick(5); expect(times).toEqual(0); jasmine.clock().tick(5); expect(times).toEqual(1); }); afterEach(function () { }); }); });
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mdarray-sol-0.1.0-java | node_modules/dc/spec/event-spec.js |