Ise strict mode for moduler under test folder

This commit is contained in:
Daniel García Aubert 2018-10-23 18:39:02 +02:00
parent 361e99006b
commit e2d27db828
125 changed files with 280 additions and 33 deletions

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
const assert = require('../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
const assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
const assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
var assert = require('../../support/assert');
var helper = require('../../support/test_helper');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
const assert = require('../../support/assert');
const testHelper = require('../../support/test_helper');
const CartodbWindshaft = require('../../../lib/cartodb/server');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
const assert = require('../../support/assert');
@ -927,6 +929,6 @@ describe('authorization', function() {
});
});
});
});
});
});

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
var fs = require('fs');

View File

@ -1,3 +1,5 @@
'use strict';
var testHelper = require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
var testHelper = require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');
var TestClient = require('../../support/test-client');

View File

@ -1,10 +1,12 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');
var TestClient = require('../../support/test-client');
describe('dataview error cases', function() {
describe('generic errors', function() {
afterEach(function(done) {
@ -21,7 +23,7 @@ describe('dataview error cases', function() {
'Content-Type': 'application/json; charset=utf-8'
}
};
function createMapConfig(dataviews) {
return {
version: '1.5.0',
@ -49,40 +51,40 @@ describe('dataview error cases', function() {
]
};
}
it('should fail when invalid dataviews object is provided, string case', function(done) {
var mapConfig = createMapConfig("wadus-string");
this.testClient = new TestClient(mapConfig, 1234);
this.testClient.getLayergroup({ response: ERROR_RESPONSE }, function(err, errObj) {
assert.ok(!err, err);
assert.deepEqual(errObj.errors, [ '"dataviews" must be a valid JSON object: "string" type found' ]);
done();
});
});
it('should fail when invalid dataviews object is provided, array case', function(done) {
var mapConfig = createMapConfig([]);
this.testClient = new TestClient(mapConfig, 1234);
this.testClient.getLayergroup({ response: ERROR_RESPONSE }, function(err, errObj) {
assert.ok(!err, err);
assert.deepEqual(errObj.errors, [ '"dataviews" must be a valid JSON object: "array" type found' ]);
done();
});
});
it('should work with empty but valid objects', function(done) {
var mapConfig = createMapConfig({});
this.testClient = new TestClient(mapConfig, 1234);
this.testClient.getLayergroup(function(err, layergroup) {
assert.ok(!err, err);
assert.ok(layergroup);
assert.ok(layergroup.layergroupid);
done();
});
});
@ -132,7 +134,7 @@ describe('dataview error cases', function() {
}
}
}
};
};
}
it('should work without filters', function(done) {
@ -184,7 +186,7 @@ describe('dataview error cases', function() {
done();
});
});
it('should not fail if query does not return rows', function(done) {
const query = 'select * from populated_places_simple_reduced limit 0';
@ -198,7 +200,7 @@ describe('dataview error cases', function() {
max: 0,
categoriesCount: 0,
categories: [],
type: 'aggregation'
type: 'aggregation'
};
this.testClient = new TestClient(createMapConfig(query));

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');
var TestClient = require('../../support/test-client');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
/* eslint-env mocha */
const assert = require('assert');
const TestClient = require('../support/test-client');
@ -316,5 +318,3 @@ describe_mvt('date-wrapping', () => {
});
});

View File

@ -1,3 +1,5 @@
'use strict';
var assert = require('../support/assert');
var step = require('step');
var LayergroupToken = require('../../lib/cartodb/models/layergroup-token');

View File

@ -1,3 +1,5 @@
'use strict';
const assert = require('../support/assert');
const TestClient = require('../support/test-client');

View File

@ -1,3 +1,5 @@
'use strict';
var assert = require('../support/assert');
var CartodbWindshaft = require(__dirname + '/../../lib/cartodb/server');
var serverOptions = require(__dirname + '/../../lib/cartodb/server_options');

View File

@ -1,3 +1,5 @@
'use strict';
require(__dirname + '/../support/test_helper');
var fs = require('fs');

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
var TestClient = require('../support/test-client');
@ -7,10 +9,10 @@ var IMAGE_TOLERANCE = 5;
describe('CartoCSS wrap', function () {
const options = {
sql: `
SELECT
5 as cartodb_id,
ST_Transform(ST_SetSRID(ST_MakePoint(-57.65625,-15.6230368),4326),3857) as the_geom_webmercator,
ST_SetSRID(ST_MakePoint(-57.65625,-15.62303683),4326) as the_geom,
SELECT
5 as cartodb_id,
ST_Transform(ST_SetSRID(ST_MakePoint(-57.65625,-15.6230368),4326),3857) as the_geom_webmercator,
ST_SetSRID(ST_MakePoint(-57.65625,-15.62303683),4326) as the_geom,
'South America' as continent
`,
cartocss: `

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
const assert = require('../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
var TestClient = require('../support/test-client');
@ -51,4 +53,4 @@ describe('layers filters', function() {
});
});
});
});

View File

@ -1,3 +1,5 @@
'use strict';
var assert = require('../support/assert');
var _ = require('underscore');
var redis = require('redis');

View File

@ -1,3 +1,5 @@
'use strict';
var testHelper = require('../support/test_helper');
var assert = require('../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
const assert = require('../support/assert');
@ -95,7 +97,7 @@ describe('MVT Mapnik', function () {
it('invalid properties', function (done) {
const query = `
select ldc, cartodb_id, _2016_6_partcntry, the_geom_webmercator, country
from countries_null_values
from countries_null_values
where country = 'Kenya' OR country = 'Sudan' LIMIT 3
`;

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
var assert = require('../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
var test_helper = require('../support/test_helper');
var assert = require('../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
var step = require('step');
var test_helper = require('../support/test_helper');

View File

@ -1,3 +1,5 @@
'use strict';
var test_helper = require('../support/test_helper');
var RedisPool = require('redis-mpool');
var querystring = require('querystring');

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
var RedisPool = require('redis-mpool');

View File

@ -1,3 +1,5 @@
'use strict';
var qs = require('querystring');
var testHelper = require('../support/test_helper');
var RedisPool = require('redis-mpool');
@ -295,10 +297,10 @@ describe('named maps static view', function() {
if (err) {
return done(err);
}
var url = `/api/v1/map/static/named/${templateName}/640/480.gif`;
var requestOptions = {
url: url,
method: 'GET',

View File

@ -1,3 +1,5 @@
'use strict';
var test_helper = require('../support/test_helper');
var RedisPool = require('redis-mpool');
var querystring = require('querystring');

View File

@ -1,3 +1,5 @@
'use strict';
var test_helper = require('../support/test_helper');
var assert = require('../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
var test_helper = require('../support/test_helper');
var assert = require('../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
var testHelper = require('../support/test_helper');
var assert = require('../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
var testHelper = require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
var testHelper = require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var fs = require('fs');

View File

@ -1,3 +1,5 @@
'use strict';
var testHelper = require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
var testHelper = require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
var testHelper =require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
var testHelper = require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
var testHelper = require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
var testHelper = require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
var testHelper = require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
var testHelper = require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
var _ = require('underscore');
var serverOptions = require('../../../../lib/cartodb/server_options');
var mapnik = require('windshaft').mapnik;

View File

@ -1,3 +1,5 @@
'use strict';
var testHelper = require('../../../support/test_helper');
var LayergroupToken = require('../../../../lib/cartodb/models/layergroup-token');

View File

@ -1,3 +1,5 @@
'use strict';
var testHelper = require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
var testHelper = require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
const assert = require('../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
var assert = require('../support/assert');
const helper = require('../support/test_helper');

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
var assert = require('../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
var assert = require('../support/assert');
@ -68,4 +70,3 @@ describe('special numeric values', function() {
});
});
});

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
var assert = require('../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
var assert = require('../support/assert');
var _ = require('underscore');
var redis = require('redis');

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
const assert = require('../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
var assert = require('../../support/assert');
var TestClient = require('../../support/test-client');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
var assert = require('../../support/assert');
var step = require('step');
var LayergroupToken = require('../../../lib/cartodb/models/layergroup-token');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');
@ -470,7 +472,7 @@ describe('turbo-carto regressions', function() {
done();
});
});
});
});
function makeMapconfig({numQuantiles = 1}) {
return {
@ -481,10 +483,10 @@ describe('turbo-carto regressions', function() {
"options": {
"cartocss_version": '2.3.0',
"sql": 'SELECT * FROM populated_places_simple_reduced',
"cartocss": `#layer {\n
marker-width: ramp([labelrank], range(1, 20), quantiles(${numQuantiles}));\n
marker-fill: #EE4D5A;\n marker-fill-opacity: 0.9;\n
marker-allow-overlap: true;\n marker-line-width: 1;\n
"cartocss": `#layer {\n
marker-width: ramp([labelrank], range(1, 20), quantiles(${numQuantiles}));\n
marker-fill: #EE4D5A;\n marker-fill-opacity: 0.9;\n
marker-allow-overlap: true;\n marker-line-width: 1;\n
marker-line-color: #FFFFFF;\n marker-line-opacity: 1;\n}`,
}
}

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
const assert = require('../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
const assert = require('../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
const assert = require('../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
var assert = require('../../support/assert');
var step = require('step');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../../support/test_helper');
var assert = require('../../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../../support/test_helper');
var assert = require('../../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../../support/test_helper');
var assert = require('../../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');
@ -260,7 +262,7 @@ describe('widgets-regressions', function() {
]]
};
const query = `
const query = `
SELECT
ST_TRANSFORM(ST_SETSRID(ST_GeomFromGeoJSON(
'${JSON.stringify(notIntersectingLeftTriangle)}'

View File

@ -1,3 +1,5 @@
'use strict';
require('../../support/test_helper');
var assert = require('../../support/assert');

View File

@ -1,3 +1,5 @@
'use strict';
var testHelper = require('../support/test_helper');
var assert = require('assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
var assert = require('assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
var assert = require('assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
var assert = require('assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
var assert = require('assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
var assert = require('assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
var assert = require('assert');

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
var assert = require('assert');
@ -68,4 +70,4 @@ describe('QueryTables', function() {
});
});
});
});

View File

@ -1,3 +1,5 @@
'use strict';
require('../support/test_helper');
var assert = require('assert');

View File

@ -1,3 +1,5 @@
'use strict';
// Cribbed from the ever prolific Konstantin Kaefer
// https://github.com/mapbox/tilelive-mapnik/blob/master/test/support/assert.js

View File

@ -1,3 +1,5 @@
'use strict';
/**
* User: simon
* Date: 30/08/2011

Some files were not shown because too many files have changed in this diff Show More