Skip to content

Commit

Permalink
Update test-suite SHA, fix for window.ImageData check in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauren Budorick committed Jan 5, 2017
1 parent 940f779 commit d0717f8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions js/util/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ function restore() {

window.restore = restore;

window.ImageData = window.ImageData || sinon.stub().returns(false);

return window;
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"in-publish": "^2.0.0",
"jsdom": "^9.4.2",
"lodash.template": "^4.4.0",
"mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#53e5081d0a9c069b02758764a8997d9168e622e0",
"mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#4fea9f9b588f5cf0dbeeeffac2be34c04ba63c1d",
"minifyify": "^7.0.1",
"npm-run-all": "^3.0.0",
"nyc": "^8.3.0",
Expand Down
9 changes: 9 additions & 0 deletions test/js/source/canvas_source.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ class StubMap extends Evented {
}

test('CanvasSource', (t) => {
t.afterEach((callback) => {
window.restore();
callback();
});

t.test('constructor', (t) => {
const source = createSource();

Expand Down Expand Up @@ -98,6 +103,8 @@ test('CanvasSource#serialize', (t) => {
t.ok(serialized.canvas);
t.deepEqual(serialized.coordinates, [[0, 0], [1, 0], [1, 1], [0, 1]]);

window.restore();

t.end();
});

Expand All @@ -112,5 +119,7 @@ test('CanvasSource#setDimensions', (t) => {
t.equal(source.resize, true);
t.deepEqual(source.dimensions, [0, 0, 30, 30]);

window.restore();

t.end();
});

0 comments on commit d0717f8

Please sign in to comment.