Lint-free tileurlfunction.test.js
This commit is contained in:
+2
-1
@@ -3,6 +3,7 @@
|
|||||||
"mocha": true
|
"mocha": true
|
||||||
},
|
},
|
||||||
"globals": {
|
"globals": {
|
||||||
"expect": true
|
"expect": true,
|
||||||
|
"sinon": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,15 +69,21 @@ describe('ol.TileUrlFunction', function() {
|
|||||||
templates, tileGrid);
|
templates, tileGrid);
|
||||||
var tileCoord = [3, 2, -2];
|
var tileCoord = [3, 2, -2];
|
||||||
|
|
||||||
sinon.stub(ol.tilecoord, 'hash', function() { return 3; });
|
sinon.stub(ol.tilecoord, 'hash', function() {
|
||||||
|
return 3;
|
||||||
|
});
|
||||||
expect(tileUrlFunction(tileCoord)).to.eql('http://tile-1/3/2/1');
|
expect(tileUrlFunction(tileCoord)).to.eql('http://tile-1/3/2/1');
|
||||||
ol.tilecoord.hash.restore();
|
ol.tilecoord.hash.restore();
|
||||||
|
|
||||||
sinon.stub(ol.tilecoord, 'hash', function() { return 2; });
|
sinon.stub(ol.tilecoord, 'hash', function() {
|
||||||
|
return 2;
|
||||||
|
});
|
||||||
expect(tileUrlFunction(tileCoord)).to.eql('http://tile-3/3/2/1');
|
expect(tileUrlFunction(tileCoord)).to.eql('http://tile-3/3/2/1');
|
||||||
ol.tilecoord.hash.restore();
|
ol.tilecoord.hash.restore();
|
||||||
|
|
||||||
sinon.stub(ol.tilecoord, 'hash', function() { return 1; });
|
sinon.stub(ol.tilecoord, 'hash', function() {
|
||||||
|
return 1;
|
||||||
|
});
|
||||||
expect(tileUrlFunction(tileCoord)).to.eql('http://tile-2/3/2/1');
|
expect(tileUrlFunction(tileCoord)).to.eql('http://tile-2/3/2/1');
|
||||||
ol.tilecoord.hash.restore();
|
ol.tilecoord.hash.restore();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user