Skip to content

Commit ee211d0

Browse files
authored
Merge pull request #1459 from OpenGeoscience/upgrade-jasmine
test: Update jasmine
2 parents 9ee0579 + a78614b commit ee211d0

7 files changed

Lines changed: 51 additions & 48 deletions

File tree

package-lock.json

Lines changed: 26 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"istanbul-lib-coverage": "^3.2.0",
6363
"istanbul-lib-report": "^3.0.1",
6464
"istanbul-reports": "^3.1.6",
65-
"jasmine-core": "^5.0.0",
65+
"jasmine-core": "^6.1.0",
6666
"js-yaml": "^4.1.0",
6767
"jsdoc": "^4.0.0",
6868
"jsdoc-autoprivate": "0.0.1",

tests/cases/osmLayer.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe('geo.core.osmLayer', function () {
4646
done: () => done()
4747
});
4848
});
49-
it('next animation', function (done) {
49+
it('next animation 1', function (done) {
5050
map.transition({
5151
center: {x: 37.6167, y: 55.7500},
5252
duration: 500,
@@ -56,7 +56,7 @@ describe('geo.core.osmLayer', function () {
5656
done: () => done()
5757
});
5858
});
59-
it('next animation', function (done) {
59+
it('next animation 2', function (done) {
6060
map.transition({
6161
center: {x: 28.9550, y: 41.0136},
6262
duration: 500,
@@ -80,7 +80,7 @@ describe('geo.core.osmLayer', function () {
8080
done: () => done()
8181
});
8282
});
83-
it('next animation', function (done) {
83+
it('next animation 3', function (done) {
8484
map.transition({
8585
center: {x: 37.6167, y: 55.7500},
8686
duration: 500,
@@ -90,7 +90,7 @@ describe('geo.core.osmLayer', function () {
9090
done: () => done()
9191
});
9292
});
93-
it('next animation', function (done) {
93+
it('next animation 4', function (done) {
9494
map.transition({
9595
center: {x: 19.0514, y: 47.4925},
9696
rotation: Math.PI * 2,
@@ -256,18 +256,18 @@ describe('geo.core.osmLayer', function () {
256256
*/
257257
var angles = {0: 21, 180: 21};
258258
$.each(angles, function (angle, numTiles) {
259-
it('null default', function () {
259+
it(`null default ${angle}`, function () {
260260
map = create_map();
261261
if (angle) {
262262
map.rotation(parseFloat(angle) * Math.PI / 180);
263263
}
264264
layer = map.createLayer('osm', {renderer: null, url: '/testdata/white.jpg'});
265265
expect(map.node().find('[data-tile-layer="0"]').length).toBe(1);
266266
});
267-
waitForIt('null tiles to load', function () {
267+
waitForIt(`null tiles to load ${angle}`, function () {
268268
return $('[tile-reference]').length === numTiles;
269269
});
270-
it('check null tiles and switch to svg', function () {
270+
it(`check null tiles and switch to svg ${angle}`, function () {
271271
positions = {};
272272
$.each($('[tile-reference]'), function () {
273273
var ref = $(this).attr('tile-reference').split('_').slice(0, 3).join('_');
@@ -277,10 +277,10 @@ describe('geo.core.osmLayer', function () {
277277
layer = map.createLayer('osm', {renderer: 'svg', url: '/testdata/white.jpg'});
278278
expect(map.node().find('[data-tile-layer="0"]').length).toBe(0);
279279
});
280-
waitForIt('svg tiles to load', function () {
280+
waitForIt(`svg tiles to load ${angle}`, function () {
281281
return $('image[reference]').length === numTiles;
282282
});
283-
it('compare tile offsets at angle ' + angle, function () {
283+
it(`compare tile offsets at angle ${angle}`, function () {
284284
$.each($('image[reference]'), function () {
285285
var ref = $(this).attr('reference').split('_').slice(0, 3).join('_');
286286
/* Only check the top level */
@@ -291,7 +291,7 @@ describe('geo.core.osmLayer', function () {
291291
}
292292
});
293293
});
294-
it('destroy', destroy_map);
294+
it(`destroy ${angle}`, destroy_map);
295295
});
296296
});
297297
});
@@ -405,7 +405,7 @@ describe('geo.core.osmLayer', function () {
405405
layer.baseQuad = undefined;
406406
expect(layer.baseQuad).toBe(undefined);
407407
});
408-
it('destroy', destroy_map);
408+
it('destroy 2', destroy_map);
409409
});
410410

411411
describe('geo.webgl.osmLayer', function () {
@@ -474,7 +474,7 @@ describe('geo.core.osmLayer', function () {
474474
waitForIt('map to draw after visible true', function () {
475475
return Object.keys(layer.activeTiles).length === 25;
476476
});
477-
it('destroy', destroy_map);
477+
it('destroy 2', destroy_map);
478478
});
479479

480480
describe('osmLayer', function () {

tests/cases/tileLayer.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -629,11 +629,6 @@ describe('geo.tileLayer', function () {
629629
{x: 3, y: 0, level: 1},
630630
true
631631
));
632-
it.apply(it, checkValidTile(
633-
opts,
634-
{x: 3, y: 0, level: 1},
635-
true
636-
));
637632
it.apply(it, checkValidTile(
638633
opts,
639634
{x: -1, y: 0, level: 1},

tests/cases/version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ describe('geo.version', function () {
55
});
66
});
77

8-
describe('geo.version', function () {
8+
describe('geo.sha', function () {
99
var geo = require('../test-utils').geo;
1010
it('Git SHA is defined', function () {
1111
expect(geo.sha).toMatch(/^[0-9a-f]{8,}$/);

tests/gl-cases/d3Vectors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
describe('svgLines', function () {
1+
describe('d3Vectors', function () {
22
var imageTest = require('../image-test');
33
var common = require('../test-common');
44
var geo = require('../test-utils').geo;

tests/test-utils.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ var geo = require('../src');
88

99
module.exports = {};
1010

11+
const _waitCounts = {};
12+
1113
/**
1214
* Provides a uniform entry point into the geojs library.
1315
*/
@@ -25,7 +27,13 @@ module.exports.vgl = geo.vgl;
2527
*/
2628
module.exports.waitForIt = function waitForIt(desc, testFunc) {
2729
'use strict';
28-
it('wait for ' + desc, function (done) {
30+
if (!_waitCounts[desc]) {
31+
_waitCounts[desc] = 1;
32+
} else {
33+
_waitCounts[desc] += 1;
34+
}
35+
const countStr = _waitCounts[desc] === 1 ? '' : ` ${_waitCounts[desc]}`;
36+
it(`wait for ${desc}${countStr}`, function (done) {
2937
var interval;
3038
interval = setInterval(function () {
3139
if (testFunc()) {
@@ -35,7 +43,7 @@ module.exports.waitForIt = function waitForIt(desc, testFunc) {
3543
}
3644
}, 10);
3745
});
38-
it('done waiting for ' + desc, function () {
46+
it(`done waiting for ${desc}${countStr}`, function () {
3947
expect(!!(testFunc ? testFunc() : true)).toBe(true);
4048
});
4149
};

0 commit comments

Comments
 (0)