Added regression test for turbo-cartocss' integration

This commit is contained in:
Daniel García Aubert 2016-03-09 11:48:07 +01:00
parent c6fbb08c8f
commit a0073da4b3
3 changed files with 40 additions and 33 deletions

View File

@ -36,11 +36,10 @@ TurboCartocssAdapter.prototype._parseCartoCss = function (username, layer, callb
}
this.turboCartocssParser.process(username, layer.options.cartocss, layer.options.sql, function (err, cartocss) {
if (err) {
return callback(err);
}
// Ignore turbo-cartocss errors and continue
if (!err && cartocss) {
layer.options.cartocss = cartocss;
}
callback(null, layer);
});

View File

@ -71,8 +71,8 @@ describe('tests from old api translated to multilayer', function() {
},
function(res) {
var parsed = JSON.parse(res.body);
assert.ok(parsed.errors[0]);
assert.ok(parsed.errors[0].match(/Unclosed block/));
assert.ok(parsed.errors[0].match(/^style0/));
assert.ok(parsed.errors[0].match(/missing closing/));
done();
}
);

View File

@ -31,9 +31,8 @@ function makeMapconfig(cartocss) {
};
}
describe.skip('turbo-cartocss regressions', function() {
describe('turbo-cartocss regressions', function() {
it('should accept // comments', function(done) {
var cartocss = [
"/** simple visualization */",
"",
@ -58,8 +57,17 @@ describe.skip('turbo-cartocss regressions', function() {
"",
"}"
].join('\n');
var testClient = new TestClient(makeMapconfig(cartocss));
testClient.createLayergroup(function(err) {
beforeEach(function () {
this.testClient = new TestClient(makeMapconfig(cartocss));
});
afterEach(function (done) {
this.testClient.drain(done);
});
it('should accept // comments', function(done) {
this.testClient.getTile(0, 0, 0, function(err) {
assert.ok(!err, err);
done();
});