forked from tilemill-project/tilemill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathabilities.test.js
57 lines (51 loc) · 1.79 KB
/
abilities.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
var assert = require('assert');
var core;
var tile;
describe('abilities', function() {
before(function(done) {
require('./support/start').start(function(command) {
core = command.servers['Core'];
tile = command.servers['Tile'];
done();
});
});
after(function(done) {
core.close();
tile.close();
done();
});
it('GET should return JSON', function(done) {
assert.response(core,
{ url: '/assets/tilemill/js/abilities.js' },
{ status: 200 },
function(res) {
var body = res.body.replace(/^\s*var\s+abilities\s*=\s*(.+?);?$/, '$1');
var abilities = JSON.parse(body);
// travis does a shallow clone so the git version and hash will
// not be known, which is harmless
if (!process.env.TRAVIS) {
assert.ok(/v\d+.\d+.\d+-\d+-[a-z0-9]+/.test(abilities.version[0]),abilities.version[0]);
assert.ok(/\d+.\d+.\d+.\d+/.test(abilities.version[1]),abilities.version[1]);
}
assert.ok(abilities.fonts.indexOf('Arial Regular') >= 0 ||
abilities.fonts.indexOf('DejaVu Sans Book') >= 0);
assert.deepEqual([0,206,209], abilities.carto.colors.darkturquoise);
assert.deepEqual([
"background-color",
"background-image",
"background-image-comp-op",
"background-image-opacity",
"srs",
"buffer-size",
"maximum-extent",
"base",
"paths-from-xml",
"minimum-version",
"font-directory"
], Object.keys(abilities.carto.symbolizers.map));
assert.equal(true,abilities.exports.mbtiles);
done();
}
);
});
});