From 94af30ff4a93226c8f268dbaa28387b7c487c3b5 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Tue, 25 Aug 2015 14:57:23 -0400 Subject: [PATCH] migrate style test fixture to v8, handle errors more gracefully in render test --- platform/node/test/fixtures/style.json | 49 ++++++++++++++------------ platform/node/test/render.test.js | 7 ++-- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/platform/node/test/fixtures/style.json b/platform/node/test/fixtures/style.json index 47a1990eb..55442c879 100644 --- a/platform/node/test/fixtures/style.json +++ b/platform/node/test/fixtures/style.json @@ -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" + } + } + ] } diff --git a/platform/node/test/render.test.js b/platform/node/test/render.test.js index b55841fef..2fab98bb9 100644 --- a/platform/node/test/render.test.js +++ b/platform/node/test/render.test.js @@ -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');