From 11ffba0a8e7298d176e41ae2a9b3735db4449569 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Tue, 17 Jan 2017 17:34:28 +0100 Subject: [PATCH] Isolate reference as options test --- test/rendering_js.test.js | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/test/rendering_js.test.js b/test/rendering_js.test.js index 68a2c15..213122d 100644 --- a/test/rendering_js.test.js +++ b/test/rendering_js.test.js @@ -1,6 +1,8 @@ var assert = require('assert'); var carto = require('../lib/carto'); +var tree = require('../lib/carto/tree'); + describe('RenderingJS', function() { var shader; var style = [ @@ -275,12 +277,25 @@ describe('RenderingJS', function() { } }; - it('should fail if a feature is not supported', function () { - assert.throws(function () { - var RendererJS = new carto.RendererJS({reference: reference, mapnik_version: '1.0.0'}); - var shader = RendererJS.render(style); - }, Error); + describe('cartocss reference in options', function() { + + before(function() { + this.referenceData = tree.Reference.data; + }); + + after(function() { + tree.Reference.setData(this.referenceData); + }); + + it('should fail if a feature is not supported', function () { + assert.throws(function () { + var RendererJS = new carto.RendererJS({reference: reference, mapnik_version: '1.0.0'}); + var shader = RendererJS.render(style); + }, Error); + }); + }); + }); });