migrate style test fixture to v8, handle errors more gracefully in render test
This commit is contained in:
49
platform/node/test/fixtures/style.json
vendored
49
platform/node/test/fixtures/style.json
vendored
@@ -1,26 +1,29 @@
|
||||
{
|
||||
"version": 7,
|
||||
"name": "Empty",
|
||||
"sources": {
|
||||
"mapbox": {
|
||||
"type": "vector",
|
||||
"url": "./fixtures/tiles.tilejson",
|
||||
"maxzoom": 15
|
||||
}
|
||||
"version": 8,
|
||||
"name": "Empty",
|
||||
"sources": {
|
||||
"mapbox": {
|
||||
"type": "vector",
|
||||
"url": "./fixtures/tiles.tilejson",
|
||||
"maxzoom": 15
|
||||
}
|
||||
},
|
||||
"layers": [
|
||||
{
|
||||
"id": "background",
|
||||
"type": "background",
|
||||
"paint": {
|
||||
"background-color": "white"
|
||||
}
|
||||
},
|
||||
"layers": [{
|
||||
"id": "background",
|
||||
"type": "background",
|
||||
"paint": {
|
||||
"background-color": "white"
|
||||
}
|
||||
}, {
|
||||
"id": "water",
|
||||
"type": "fill",
|
||||
"source": "mapbox",
|
||||
"source-layer": "water",
|
||||
"paint": {
|
||||
"fill-color": "blue"
|
||||
}
|
||||
}]
|
||||
{
|
||||
"id": "water",
|
||||
"type": "fill",
|
||||
"source": "mapbox",
|
||||
"source-layer": "water",
|
||||
"paint": {
|
||||
"fill-color": "blue"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -53,10 +53,13 @@ function renderTest(style, info, base, key) {
|
||||
map.load(style);
|
||||
|
||||
map.render(info[key], function(err, data) {
|
||||
t.error(err);
|
||||
|
||||
map.release();
|
||||
|
||||
if (err) {
|
||||
t.error(err);
|
||||
return t.end();
|
||||
}
|
||||
|
||||
var expected = path.join(dir, 'expected.png');
|
||||
var actual = path.join(dir, 'actual.png');
|
||||
var diff = path.join(dir, 'diff.png');
|
||||
|
||||
Reference in New Issue
Block a user