Skip to content

Commit

Permalink
Add a test.
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Aug 30, 2018
1 parent f2c1d4a commit fd8dc0a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/cases/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,20 @@ describe('geo.core.map', function () {
expect(queue3).not.toEqual(queue2);
unmockAnimationFrame();
});
it('animationQueue with bad callback', function () {
mockAnimationFrame();
var error = sinon.stub(console, 'error', function () {}),
m = createMap(),
called = 0,
start = new Date().getTime();
m.scheduleAnimationFrame(function () { throw new Error('fail'); });
m.scheduleAnimationFrame(function () { called += 1; });
stepAnimationFrame(start);
unmockAnimationFrame();
expect(called).toBe(1);
expect(error.calledOnce).toBe(true);
console.error.restore();
});
it('autoResize', function () {
var m = createMap();
expect(m.autoResize()).toBe(true);
Expand Down

0 comments on commit fd8dc0a

Please sign in to comment.