tileserver-gl-light 4.0.0 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/test/style.js CHANGED
@@ -1,14 +1,14 @@
1
- var testIs = function(url, type, status) {
1
+ const testIs = function(url, type, status) {
2
2
  it(url + ' return ' + (status || 200) + ' and is ' + type.toString(),
3
3
  function(done) {
4
- supertest(app)
5
- .get(url)
6
- .expect(status || 200)
7
- .expect('Content-Type', type, done);
8
- });
4
+ supertest(app)
5
+ .get(url)
6
+ .expect(status || 200)
7
+ .expect('Content-Type', type, done);
8
+ });
9
9
  };
10
10
 
11
- var prefix = 'test-style';
11
+ const prefix = 'test-style';
12
12
 
13
13
  describe('Styles', function() {
14
14
  describe('/styles/' + prefix + '/style.json is valid style', function() {
@@ -16,16 +16,16 @@ describe('Styles', function() {
16
16
 
17
17
  it('contains expected properties', function(done) {
18
18
  supertest(app)
19
- .get('/styles/' + prefix + '/style.json')
20
- .expect(function(res) {
21
- res.body.version.should.equal(8);
22
- res.body.name.should.be.String();
23
- res.body.sources.should.be.Object();
24
- res.body.glyphs.should.be.String();
25
- res.body.sprite.should.be.String();
26
- res.body.sprite.should.equal('/test/styles/test-style/sprite');
27
- res.body.layers.should.be.Array();
28
- }).end(done);
19
+ .get('/styles/' + prefix + '/style.json')
20
+ .expect(function(res) {
21
+ expect(res.body.version).to.be.equal(8);
22
+ expect(res.body.name).to.be.a('string');
23
+ expect(res.body.sources).to.be.a('object');
24
+ expect(res.body.glyphs).to.be.a('string');
25
+ expect(res.body.sprite).to.be.a('string');
26
+ expect(res.body.sprite).to.be.equal('/test/styles/test-style/sprite');
27
+ expect(res.body.layers).to.be.a('array');
28
+ }).end(done);
29
29
  });
30
30
  });
31
31
  describe('/styles/streets/style.json is not served', function() {
@@ -44,7 +44,7 @@ describe('Fonts', function() {
44
44
  testIs('/fonts/Open Sans Bold/0-255.pbf', /application\/x-protobuf/);
45
45
  testIs('/fonts/Open Sans Regular/65280-65535.pbf', /application\/x-protobuf/);
46
46
  testIs('/fonts/Open Sans Bold,Open Sans Regular/0-255.pbf',
47
- /application\/x-protobuf/);
47
+ /application\/x-protobuf/);
48
48
  testIs('/fonts/Nonsense,Open Sans Bold/0-255.pbf', /./, 400);
49
49
 
50
50
  testIs('/fonts/Nonsense/0-255.pbf', /./, 400);
@@ -1,14 +1,14 @@
1
- var testTile = function(prefix, z, x, y, status) {
2
- var path = '/data/' + prefix + '/' + z + '/' + x + '/' + y + '.pbf';
1
+ const testTile = function(prefix, z, x, y, status) {
2
+ const path = '/data/' + prefix + '/' + z + '/' + x + '/' + y + '.pbf';
3
3
  it(path + ' returns ' + status, function(done) {
4
- var test = supertest(app).get(path);
4
+ const test = supertest(app).get(path);
5
5
  if (status) test.expect(status);
6
6
  if (status == 200) test.expect('Content-Type', /application\/x-protobuf/);
7
7
  test.end(done);
8
8
  });
9
9
  };
10
10
 
11
- var prefix = 'openmaptiles';
11
+ const prefix = 'openmaptiles';
12
12
 
13
13
  describe('Vector tiles', function() {
14
14
  describe('existing tiles', function() {
@@ -1,15 +1,15 @@
1
- var testTile = function(prefix, z, x, y, format, status, scale, type) {
1
+ const testTile = function(prefix, z, x, y, format, status, scale, type) {
2
2
  if (scale) y += '@' + scale + 'x';
3
- var path = '/styles/' + prefix + '/' + z + '/' + x + '/' + y + '.' + format;
3
+ const path = '/styles/' + prefix + '/' + z + '/' + x + '/' + y + '.' + format;
4
4
  it(path + ' returns ' + status, function(done) {
5
- var test = supertest(app).get(path);
5
+ const test = supertest(app).get(path);
6
6
  test.expect(status);
7
7
  if (type) test.expect('Content-Type', type);
8
8
  test.end(done);
9
9
  });
10
10
  };
11
11
 
12
- var prefix = 'test-style';
12
+ const prefix = 'test-style';
13
13
 
14
14
  describe('Raster tiles', function() {
15
15
  describe('valid requests', function() {
@@ -41,6 +41,6 @@ describe('Raster tiles', function() {
41
41
  testTile(prefix, 0, 0, 0, 'png', 404, 1);
42
42
  testTile(prefix, 0, 0, 0, 'png', 404, 5);
43
43
 
44
- //testTile('hybrid', 0, 0, 0, 'png', 404); //TODO: test this
44
+ // testTile('hybrid', 0, 0, 0, 'png', 404); //TODO: test this
45
45
  });
46
46
  });