Replace assert.equal() by assert.strictEqual()
This commit is contained in:
@@ -102,7 +102,7 @@ describe('mapnik-layer-stats', function () {
|
||||
var testSubject = new MapnikLayerStats();
|
||||
testSubject.getStats(layer, this.dbConnectionMock, function (err, result) {
|
||||
assert.ifError(err);
|
||||
assert.equal(result.estimatedFeatureCount, 1);
|
||||
assert.strictEqual(result.estimatedFeatureCount, 1);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -115,10 +115,10 @@ describe('mapnik-layer-stats', function () {
|
||||
var testSubject = new MapnikLayerStats();
|
||||
testSubject.getStats(layer0, self.dbConnectionMock, function (err, result) {
|
||||
assert.ifError(err);
|
||||
assert.equal(result.estimatedFeatureCount, 1);
|
||||
assert.strictEqual(result.estimatedFeatureCount, 1);
|
||||
testSubject.getStats(layer1, self.dbConnectionMock, function (err, result) {
|
||||
assert.ifError(err);
|
||||
assert.equal(result.estimatedFeatureCount, 1);
|
||||
assert.strictEqual(result.estimatedFeatureCount, 1);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -130,7 +130,7 @@ describe('mapnik-layer-stats', function () {
|
||||
var testSubject = new MapnikLayerStats();
|
||||
testSubject.getStats(layer, this.dbConnectionMock, function (err, result) {
|
||||
assert.ifError(err);
|
||||
assert.equal(result.estimatedFeatureCount, 1);
|
||||
assert.strictEqual(result.estimatedFeatureCount, 1);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -143,10 +143,10 @@ describe('mapnik-layer-stats', function () {
|
||||
var testSubject = new MapnikLayerStats();
|
||||
testSubject.getStats(layer0, self.dbConnectionMock, function (err, result) {
|
||||
assert.ifError(err);
|
||||
assert.equal(result.estimatedFeatureCount, 1);
|
||||
assert.strictEqual(result.estimatedFeatureCount, 1);
|
||||
testSubject.getStats(layer1, self.dbConnectionMock, function (err, result) {
|
||||
assert.ifError(err);
|
||||
assert.equal(result.estimatedFeatureCount, 1);
|
||||
assert.strictEqual(result.estimatedFeatureCount, 1);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
+5
-5
@@ -17,15 +17,15 @@ describe('cache named maps entry', function () {
|
||||
});
|
||||
|
||||
it('key is 8 chars length', function () {
|
||||
assert.equal(entryKey.length, 8);
|
||||
assert.strictEqual(entryKey.length, 8);
|
||||
var entryKeyParts = entryKey.split(':');
|
||||
assert.equal(entryKeyParts.length, 2);
|
||||
assert.equal(entryKeyParts[0], 'n');
|
||||
assert.strictEqual(entryKeyParts.length, 2);
|
||||
assert.strictEqual(entryKeyParts[0], 'n');
|
||||
});
|
||||
|
||||
it('key is name spaced for named maps', function () {
|
||||
var entryKeyParts = entryKey.split(':');
|
||||
assert.equal(entryKeyParts.length, 2);
|
||||
assert.equal(entryKeyParts[0], 'n');
|
||||
assert.strictEqual(entryKeyParts.length, 2);
|
||||
assert.strictEqual(entryKeyParts[0], 'n');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -25,7 +25,7 @@ describe('req2params', function () {
|
||||
var cdbRequest = new CdbRequest();
|
||||
var user = cdbRequest.userByReq(createRequest('localhost'));
|
||||
|
||||
assert.equal(user, 'localhost');
|
||||
assert.strictEqual(user, 'localhost');
|
||||
});
|
||||
|
||||
it('extracts name from subdomain host header in case of no config', function () {
|
||||
@@ -37,14 +37,14 @@ describe('req2params', function () {
|
||||
|
||||
global.environment.user_from_host = userFromHostConfig;
|
||||
|
||||
assert.equal(user, 'development');
|
||||
assert.strictEqual(user, 'development');
|
||||
});
|
||||
|
||||
it('considers user param before headers', function () {
|
||||
var cdbRequest = new CdbRequest();
|
||||
var user = cdbRequest.userByReq(createRequest('localhost', 'development'));
|
||||
|
||||
assert.equal(user, 'development');
|
||||
assert.strictEqual(user, 'development');
|
||||
});
|
||||
|
||||
it('returns undefined when it cannot extract username', function () {
|
||||
@@ -56,7 +56,7 @@ describe('req2params', function () {
|
||||
|
||||
global.environment.user_from_host = userFromHostConfig;
|
||||
|
||||
assert.equal(user, undefined);
|
||||
assert.strictEqual(user, undefined);
|
||||
});
|
||||
|
||||
it('should not fail for undefined host header', function () {
|
||||
@@ -68,7 +68,7 @@ describe('req2params', function () {
|
||||
|
||||
global.environment.user_from_host = userFromHostConfig;
|
||||
|
||||
assert.equal(user, undefined);
|
||||
assert.strictEqual(user, undefined);
|
||||
});
|
||||
|
||||
it('should not fail for null host header', function () {
|
||||
@@ -80,6 +80,6 @@ describe('req2params', function () {
|
||||
|
||||
global.environment.user_from_host = userFromHostConfig;
|
||||
|
||||
assert.equal(user, undefined);
|
||||
assert.strictEqual(user, undefined);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -8,13 +8,13 @@ var errorMiddleware = require('../../lib/api/middlewares/error-middleware');
|
||||
describe('error-middleware', function () {
|
||||
it('different formats for postgis plugin error returns 400 as status code', function () {
|
||||
var expectedStatusCode = 400;
|
||||
assert.equal(
|
||||
assert.strictEqual(
|
||||
errorMiddleware.findStatusCode('Postgis Plugin: ERROR: column "missing" does not exist\n'),
|
||||
expectedStatusCode,
|
||||
'Error status code for single line does not match'
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
assert.strictEqual(
|
||||
errorMiddleware.findStatusCode('Postgis Plugin: PSQL error:\nERROR: column "missing" does not exist\n'),
|
||||
expectedStatusCode,
|
||||
'Error status code for multiline/PSQL does not match'
|
||||
|
||||
@@ -33,7 +33,7 @@ describe('lzma-middleware', function () {
|
||||
}
|
||||
var query = req.query;
|
||||
assert.deepEqual(qo.config, query.config);
|
||||
assert.equal('test', query.api_key);
|
||||
assert.strictEqual('test', query.api_key);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -31,9 +31,9 @@ describe('MapConfigAdapter', function () {
|
||||
var Mul2ValMapConfigAdapter = createAdapter(function (val) { return val * 2; });
|
||||
|
||||
function validateMapConfig (adapter, expectedNumAdapters, expectedVal, callback) {
|
||||
assert.equal(adapter.adapters.length, expectedNumAdapters);
|
||||
assert.strictEqual(adapter.adapters.length, expectedNumAdapters);
|
||||
adapter.getMapConfig(user, requestMapConfig(), params(), context(), function (err, mapConfig) {
|
||||
assert.equal(mapConfig.val, expectedVal);
|
||||
assert.strictEqual(mapConfig.val, expectedVal);
|
||||
return callback(err);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -16,11 +16,11 @@ describe('coordinates middleware', function () {
|
||||
const res = {};
|
||||
|
||||
coords(req, res, function (err) {
|
||||
assert.equal(
|
||||
assert.strictEqual(
|
||||
err.message,
|
||||
'Invalid zoom value (-1). It should be an integer number greather than or equal to 0'
|
||||
);
|
||||
assert.equal(err.http_status, 400);
|
||||
assert.strictEqual(err.http_status, 400);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -37,11 +37,11 @@ describe('coordinates middleware', function () {
|
||||
const res = {};
|
||||
|
||||
coords(req, res, function (err) {
|
||||
assert.equal(
|
||||
assert.strictEqual(
|
||||
err.message,
|
||||
'Invalid zoom value (1.1). It should be an integer number greather than or equal to 0'
|
||||
);
|
||||
assert.equal(err.http_status, 400);
|
||||
assert.strictEqual(err.http_status, 400);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -58,11 +58,11 @@ describe('coordinates middleware', function () {
|
||||
const res = {};
|
||||
|
||||
coords(req, res, function (err) {
|
||||
assert.equal(
|
||||
assert.strictEqual(
|
||||
err.message,
|
||||
'Invalid zoom value (0.1). It should be an integer number greather than or equal to 0'
|
||||
);
|
||||
assert.equal(err.http_status, 400);
|
||||
assert.strictEqual(err.http_status, 400);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -79,11 +79,11 @@ describe('coordinates middleware', function () {
|
||||
const res = {};
|
||||
|
||||
coords(req, res, function (err) {
|
||||
assert.equal(
|
||||
assert.strictEqual(
|
||||
err.message,
|
||||
'Invalid zoom value (wadus). It should be an integer number greather than or equal to 0'
|
||||
);
|
||||
assert.equal(err.http_status, 400);
|
||||
assert.strictEqual(err.http_status, 400);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -117,8 +117,8 @@ describe('coordinates middleware', function () {
|
||||
const res = {};
|
||||
|
||||
coords(req, res, function (err) {
|
||||
assert.equal(err.message, 'Invalid coodinate \'x\' value (1.1). It should be an integer number');
|
||||
assert.equal(err.http_status, 400);
|
||||
assert.strictEqual(err.message, 'Invalid coodinate \'x\' value (1.1). It should be an integer number');
|
||||
assert.strictEqual(err.http_status, 400);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -135,8 +135,8 @@ describe('coordinates middleware', function () {
|
||||
const res = {};
|
||||
|
||||
coords(req, res, function (err) {
|
||||
assert.equal(err.message, 'Invalid coodinate \'x\' value (wadus). It should be an integer number');
|
||||
assert.equal(err.http_status, 400);
|
||||
assert.strictEqual(err.message, 'Invalid coodinate \'x\' value (wadus). It should be an integer number');
|
||||
assert.strictEqual(err.http_status, 400);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -170,11 +170,11 @@ describe('coordinates middleware', function () {
|
||||
const res = {};
|
||||
|
||||
coords(req, res, function (err) {
|
||||
assert.equal(
|
||||
assert.strictEqual(
|
||||
err.message,
|
||||
'Invalid coodinate \'y\' value (-1). It should be an integer number greather than or equal to 0'
|
||||
);
|
||||
assert.equal(err.http_status, 400);
|
||||
assert.strictEqual(err.http_status, 400);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -191,11 +191,11 @@ describe('coordinates middleware', function () {
|
||||
const res = {};
|
||||
|
||||
coords(req, res, function (err) {
|
||||
assert.equal(
|
||||
assert.strictEqual(
|
||||
err.message,
|
||||
'Invalid coodinate \'y\' value (1.1). It should be an integer number greather than or equal to 0'
|
||||
);
|
||||
assert.equal(err.http_status, 400);
|
||||
assert.strictEqual(err.http_status, 400);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -212,11 +212,11 @@ describe('coordinates middleware', function () {
|
||||
const res = {};
|
||||
|
||||
coords(req, res, function (err) {
|
||||
assert.equal(
|
||||
assert.strictEqual(
|
||||
err.message,
|
||||
'Invalid coodinate \'y\' value (wadus). It should be an integer number greather than or equal to 0'
|
||||
);
|
||||
assert.equal(err.http_status, 400);
|
||||
assert.strictEqual(err.http_status, 400);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -248,11 +248,11 @@ describe('coordinates middleware', function () {
|
||||
const res = {};
|
||||
|
||||
coords(req, res, function (err) {
|
||||
assert.equal(
|
||||
assert.strictEqual(
|
||||
err.message,
|
||||
'Invalid zoom value (-1.1). It should be an integer number greather than or equal to 0'
|
||||
);
|
||||
assert.equal(err.http_status, 400);
|
||||
assert.strictEqual(err.http_status, 400);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -28,13 +28,13 @@ describe('Bounding box filter', function () {
|
||||
it(util.format('should adjust from %j to %j', scenario[0], scenario[1]), function () {
|
||||
var we = BboxFilter.adjustLongitudeRange(scenario[0]);
|
||||
|
||||
assert.equal(
|
||||
assert.strictEqual(
|
||||
we[0], scenario[1][0],
|
||||
util.format('west, got %d, expected %d, scenario: %s',
|
||||
we[1], scenario[1][1], JSON.stringify(scenario)
|
||||
)
|
||||
);
|
||||
assert.equal(
|
||||
assert.strictEqual(
|
||||
we[1], scenario[1][1],
|
||||
util.format('east, got %d, expected %d, scenario: %s',
|
||||
we[1], scenario[1][1], JSON.stringify(scenario)
|
||||
@@ -56,7 +56,7 @@ describe('Bounding box filter', function () {
|
||||
it('happy case', function () {
|
||||
var bbox = [-90, -45, 90, 45];
|
||||
var bboxFilter = createFilter(bbox);
|
||||
assert.equal(bboxFilter.bboxes.length, 1);
|
||||
assert.strictEqual(bboxFilter.bboxes.length, 1);
|
||||
assert.deepEqual(bboxFilter.bboxes[0], createRef(bbox));
|
||||
});
|
||||
|
||||
@@ -64,14 +64,14 @@ describe('Bounding box filter', function () {
|
||||
it('(hardcoded) clipping out of bounds', function () {
|
||||
var bbox = [-180, -90, 180, 90];
|
||||
var bboxFilter = createFilter(bbox);
|
||||
assert.equal(bboxFilter.bboxes.length, 1);
|
||||
assert.strictEqual(bboxFilter.bboxes.length, 1);
|
||||
assert.deepEqual(bboxFilter.bboxes[0], MAX_EXTENT_MERCATOR_REF);
|
||||
});
|
||||
|
||||
it('clipping out of bounds', function () {
|
||||
var bbox = [-180, -90, 180, 90];
|
||||
var bboxFilter = createFilter(bbox);
|
||||
assert.equal(bboxFilter.bboxes.length, 1);
|
||||
assert.strictEqual(bboxFilter.bboxes.length, 1);
|
||||
assert.deepEqual(
|
||||
bboxFilter.bboxes[0],
|
||||
createRef([-180, -BboxFilter.LATITUDE_MAX_VALUE, 180, BboxFilter.LATITUDE_MAX_VALUE])
|
||||
@@ -84,7 +84,7 @@ describe('Bounding box filter', function () {
|
||||
var bbox = [90, -45, 360, 45];
|
||||
var bboxFilter = createFilter(bbox);
|
||||
|
||||
assert.equal(bboxFilter.bboxes.length, 2, JSON.stringify([bboxFilter.bboxes, bbox]));
|
||||
assert.strictEqual(bboxFilter.bboxes.length, 2, JSON.stringify([bboxFilter.bboxes, bbox]));
|
||||
|
||||
assert.deepEqual(
|
||||
bboxFilter.bboxes[0],
|
||||
@@ -100,7 +100,7 @@ describe('Bounding box filter', function () {
|
||||
var bbox = [-270, -45, 0, 45];
|
||||
var bboxFilter = createFilter(bbox);
|
||||
|
||||
assert.equal(bboxFilter.bboxes.length, 2);
|
||||
assert.strictEqual(bboxFilter.bboxes.length, 2);
|
||||
|
||||
assert.deepEqual(
|
||||
bboxFilter.bboxes[0],
|
||||
@@ -116,7 +116,7 @@ describe('Bounding box filter', function () {
|
||||
var bbox = [90, -45, 190, 45];
|
||||
var bboxFilter = createFilter(bbox);
|
||||
|
||||
assert.equal(bboxFilter.bboxes.length, 2);
|
||||
assert.strictEqual(bboxFilter.bboxes.length, 2);
|
||||
|
||||
assert.deepEqual(
|
||||
bboxFilter.bboxes[0],
|
||||
@@ -134,7 +134,7 @@ describe('Bounding box filter', function () {
|
||||
var bbox = [-190, -45, 190, 45];
|
||||
var bboxFilter = createFilter(bbox);
|
||||
|
||||
assert.equal(bboxFilter.bboxes.length, 1);
|
||||
assert.strictEqual(bboxFilter.bboxes.length, 1);
|
||||
|
||||
assert.deepEqual(
|
||||
bboxFilter.bboxes[0],
|
||||
|
||||
@@ -34,8 +34,8 @@ describe('ResourceLocator', function () {
|
||||
var urls = resourceLocator.getUrls(USERNAME, RESOURCE);
|
||||
assert.ok(urls);
|
||||
|
||||
assert.equal(urls.http, ['http://cdn.carto.com', USERNAME, 'api/v1/map', RESOURCE].join('/'));
|
||||
assert.equal(urls.https, ['https://cdn.ssl.carto.com', USERNAME, 'api/v1/map', RESOURCE].join('/'));
|
||||
assert.strictEqual(urls.http, ['http://cdn.carto.com', USERNAME, 'api/v1/map', RESOURCE].join('/'));
|
||||
assert.strictEqual(urls.https, ['https://cdn.ssl.carto.com', USERNAME, 'api/v1/map', RESOURCE].join('/'));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -94,11 +94,11 @@ describe('ResourceLocator', function () {
|
||||
var urls = resourceLocator.getUrls(USERNAME, RESOURCE);
|
||||
assert.ok(urls);
|
||||
|
||||
assert.equal(
|
||||
assert.strictEqual(
|
||||
urls.http,
|
||||
['http://' + USERNAME + '.localhost.lan', 'api/v1/map', RESOURCE].join('/')
|
||||
);
|
||||
assert.equal(
|
||||
assert.strictEqual(
|
||||
urls.https,
|
||||
['https://' + USERNAME + '.ssl.localhost.lan', 'api/v1/map', RESOURCE].join('/')
|
||||
);
|
||||
@@ -169,11 +169,11 @@ describe('ResourceLocator', function () {
|
||||
var httpSubdomain = ResourceLocator.subdomain(HTTP_SUBDOMAINS, RESOURCE);
|
||||
var httpsSubdomain = ResourceLocator.subdomain(HTTPS_SUBDOMAINS, RESOURCE);
|
||||
|
||||
assert.equal(
|
||||
assert.strictEqual(
|
||||
urls.http,
|
||||
['http://' + httpSubdomain + '.cdn.carto.com', USERNAME, 'api/v1/map', RESOURCE].join('/')
|
||||
);
|
||||
assert.equal(
|
||||
assert.strictEqual(
|
||||
urls.https,
|
||||
['https://cdn_' + httpsSubdomain + '.ssl.cdn.carto.com', USERNAME, 'api/v1/map', RESOURCE].join('/')
|
||||
);
|
||||
@@ -250,11 +250,11 @@ describe('ResourceLocator', function () {
|
||||
var httpSubdomain = ResourceLocator.subdomain(HTTP_SUBDOMAINS, RESOURCE);
|
||||
var httpsSubdomain = ResourceLocator.subdomain(HTTPS_SUBDOMAINS, RESOURCE);
|
||||
|
||||
assert.equal(
|
||||
assert.strictEqual(
|
||||
urls.http,
|
||||
['http://' + httpSubdomain + '.cdn.carto.com', 'u', USERNAME, 'api/v1/map', RESOURCE].join('/')
|
||||
);
|
||||
assert.equal(
|
||||
assert.strictEqual(
|
||||
urls.https,
|
||||
`https://cdn_${httpsSubdomain}.ssl.cdn.carto.com/u/${USERNAME}/api/v1/map/${RESOURCE}`
|
||||
);
|
||||
|
||||
@@ -14,18 +14,18 @@ function normalize_whitespace (txt) {
|
||||
|
||||
// compare SQL statements ignoring whitespace
|
||||
function assertSameSql (sql1, sql2) {
|
||||
assert.equal(normalize_whitespace(sql1), normalize_whitespace(sql2));
|
||||
assert.strictEqual(normalize_whitespace(sql1), normalize_whitespace(sql2));
|
||||
}
|
||||
|
||||
describe('Overviews query rewriter', function () {
|
||||
it('does not alter queries if no overviews data is present', function () {
|
||||
var sql = 'SELECT * FROM table1';
|
||||
var overviews_sql = overviewsQueryRewriter.query(sql);
|
||||
assert.equal(overviews_sql, sql);
|
||||
assert.strictEqual(overviews_sql, sql);
|
||||
overviews_sql = overviewsQueryRewriter.query(sql, {});
|
||||
assert.equal(overviews_sql, sql);
|
||||
assert.strictEqual(overviews_sql, sql);
|
||||
overviews_sql = overviewsQueryRewriter.query(sql, { overviews: {} });
|
||||
assert.equal(overviews_sql, sql);
|
||||
assert.strictEqual(overviews_sql, sql);
|
||||
});
|
||||
|
||||
it('does not alter queries which don\'t use overviews', function () {
|
||||
@@ -40,7 +40,7 @@ describe('Overviews query rewriter', function () {
|
||||
}
|
||||
};
|
||||
var overviews_sql = overviewsQueryRewriter.query(sql, data);
|
||||
assert.equal(overviews_sql, sql);
|
||||
assert.strictEqual(overviews_sql, sql);
|
||||
});
|
||||
|
||||
// jshint multistr:true
|
||||
@@ -407,31 +407,31 @@ describe('Overviews query rewriter', function () {
|
||||
}
|
||||
};
|
||||
var overviews_sql = overviewsQueryRewriter.query(sql, data);
|
||||
assert.equal(overviews_sql, sql);
|
||||
assert.strictEqual(overviews_sql, sql);
|
||||
|
||||
sql = 'SELECT * FROM table1 JOIN table2 ON (table1.col1=table2.col1)';
|
||||
overviews_sql = overviewsQueryRewriter.query(sql, data);
|
||||
assert.equal(overviews_sql, sql);
|
||||
assert.strictEqual(overviews_sql, sql);
|
||||
|
||||
sql = 'SELECT a+b AS c FROM table1';
|
||||
overviews_sql = overviewsQueryRewriter.query(sql, data);
|
||||
assert.equal(overviews_sql, sql);
|
||||
assert.strictEqual(overviews_sql, sql);
|
||||
|
||||
sql = 'SELECT f(a) AS b FROM table1';
|
||||
overviews_sql = overviewsQueryRewriter.query(sql, data);
|
||||
assert.equal(overviews_sql, sql);
|
||||
assert.strictEqual(overviews_sql, sql);
|
||||
|
||||
sql = 'SELECT * FROM table1 AS x';
|
||||
overviews_sql = overviewsQueryRewriter.query(sql, data);
|
||||
assert.equal(overviews_sql, sql);
|
||||
assert.strictEqual(overviews_sql, sql);
|
||||
|
||||
sql = 'WITH a AS (1) SELECT * FROM table1';
|
||||
overviews_sql = overviewsQueryRewriter.query(sql, data);
|
||||
assert.equal(overviews_sql, sql);
|
||||
assert.strictEqual(overviews_sql, sql);
|
||||
|
||||
sql = 'SELECT * FROM table1 WHERE a=1';
|
||||
overviews_sql = overviewsQueryRewriter.query(sql, data);
|
||||
assert.equal(overviews_sql, sql);
|
||||
assert.strictEqual(overviews_sql, sql);
|
||||
|
||||
sql = "\
|
||||
SELECT table1.* FROM table1 \
|
||||
@@ -439,11 +439,11 @@ describe('Overviews query rewriter', function () {
|
||||
WHERE areas.name='A' \
|
||||
";
|
||||
overviews_sql = overviewsQueryRewriter.query(sql, data);
|
||||
assert.equal(overviews_sql, sql);
|
||||
assert.strictEqual(overviews_sql, sql);
|
||||
|
||||
sql = 'SELECT table1.*, column1, column2, column3 FROM table1';
|
||||
overviews_sql = overviewsQueryRewriter.query(sql, data);
|
||||
assert.equal(overviews_sql, sql);
|
||||
assert.strictEqual(overviews_sql, sql);
|
||||
});
|
||||
|
||||
it('generates overviews for wrapped query', function () {
|
||||
@@ -604,6 +604,6 @@ describe('Overviews query rewriter', function () {
|
||||
filter_stats: { unfiltered_rows: 1000, filtered_rows: 10 }
|
||||
};
|
||||
var overviews_sql = overviewsQueryRewriter.query(sql, data);
|
||||
assert.equal(overviews_sql, sql);
|
||||
assert.strictEqual(overviews_sql, sql);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -8,7 +8,7 @@ var ProfilerProxy = require('../../../lib/stats/profiler-proxy');
|
||||
describe('profiler', function () {
|
||||
it('Profiler is null in ProfilerProxy when profiling is not enabled', function () {
|
||||
var profilerProxy = new ProfilerProxy({ profile: false });
|
||||
assert.equal(profilerProxy.profiler, null);
|
||||
assert.strictEqual(profilerProxy.profiler, null);
|
||||
});
|
||||
|
||||
it('Profiler is NOT null in ProfilerProxy when profiling is enabled', function () {
|
||||
|
||||
@@ -24,17 +24,17 @@ describe('stats client', function () {
|
||||
|
||||
statsClient.socket.emit('error', 'other_error');
|
||||
assert.ok(statsClient.last_error);
|
||||
assert.equal(statsClient.last_error.msg, 'other_error');
|
||||
assert.strictEqual(statsClient.last_error.msg, 'other_error');
|
||||
assert.ok(!statsClient.last_error.interval);
|
||||
|
||||
statsClient.socket.emit('error', WADUS_ERROR);
|
||||
assert.ok(statsClient.last_error);
|
||||
assert.equal(statsClient.last_error.msg, WADUS_ERROR);
|
||||
assert.strictEqual(statsClient.last_error.msg, WADUS_ERROR);
|
||||
assert.ok(!statsClient.last_error.interval);
|
||||
|
||||
statsClient.socket.emit('error', WADUS_ERROR);
|
||||
assert.ok(statsClient.last_error);
|
||||
assert.equal(statsClient.last_error.msg, WADUS_ERROR);
|
||||
assert.strictEqual(statsClient.last_error.msg, WADUS_ERROR);
|
||||
assert.ok(statsClient.last_error.interval);
|
||||
|
||||
done();
|
||||
|
||||
@@ -8,7 +8,7 @@ var serverOptions = require('../../../lib/server-options');
|
||||
|
||||
describe('windshaft', function () {
|
||||
it('should have valid global environment', function () {
|
||||
assert.equal(global.environment.name, 'test');
|
||||
assert.strictEqual(global.environment.name, 'test');
|
||||
});
|
||||
|
||||
it('can instantiate a Windshaft object (configured express instance)', function () {
|
||||
|
||||
@@ -89,7 +89,7 @@ describe('prepare-context', function () {
|
||||
assert.ok(!req.query.hasOwnProperty('dbuser'), 'dbuser was removed from query');
|
||||
assert.ok(res.hasOwnProperty('locals'), 'response has locals');
|
||||
assert.ok(!res.locals.hasOwnProperty('interactivity'), 'response locals do not have interactivity');
|
||||
assert.equal(res.locals.dbname, test_database);
|
||||
assert.strictEqual(res.locals.dbname, test_database);
|
||||
assert.ok(res.locals.dbuser === test_pubuser, 'could inject dbuser (' + res.locals.dbuser + ')');
|
||||
done();
|
||||
});
|
||||
@@ -120,8 +120,8 @@ describe('prepare-context', function () {
|
||||
assert.ok(!req.query.hasOwnProperty('dbuser'), 'dbuser was removed from query');
|
||||
assert.ok(res.hasOwnProperty('locals'), 'response has locals');
|
||||
assert.ok(!res.locals.hasOwnProperty('interactivity'), 'request params do not have interactivity');
|
||||
assert.equal(res.locals.dbname, test_database);
|
||||
assert.equal(res.locals.dbuser, test_user);
|
||||
assert.strictEqual(res.locals.dbname, test_database);
|
||||
assert.strictEqual(res.locals.dbuser, test_user);
|
||||
|
||||
req = {
|
||||
headers: {
|
||||
@@ -166,8 +166,8 @@ describe('prepare-context', function () {
|
||||
}
|
||||
|
||||
assert.deepEqual(config, req.query.config);
|
||||
assert.equal('test', req.query.api_key);
|
||||
assert.equal(undefined, req.query.non_included);
|
||||
assert.strictEqual('test', req.query.api_key);
|
||||
assert.strictEqual(undefined, req.query.non_included);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -189,7 +189,7 @@ describe('prepare-context', function () {
|
||||
}
|
||||
var query = res.locals;
|
||||
|
||||
assert.equal('1234', query.api_key);
|
||||
assert.strictEqual('1234', query.api_key);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -210,7 +210,7 @@ describe('prepare-context', function () {
|
||||
}
|
||||
var query = res.locals;
|
||||
|
||||
assert.equal('1234', query.api_key);
|
||||
assert.strictEqual('1234', query.api_key);
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -229,7 +229,7 @@ describe('prepare-context', function () {
|
||||
}
|
||||
var query = res.locals;
|
||||
|
||||
assert.equal('1234', query.api_key);
|
||||
assert.strictEqual('1234', query.api_key);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -34,8 +34,8 @@ describe('SubstitutionTokens', function () {
|
||||
});
|
||||
|
||||
it('should report sql has tokens', function () {
|
||||
assert.equal(SubstitutionTokens.hasTokens(sql), true);
|
||||
assert.equal(SubstitutionTokens.hasTokens('select !bbox! from wadus'), true);
|
||||
assert.equal(SubstitutionTokens.hasTokens('select !wadus! from wadus'), false);
|
||||
assert.strictEqual(SubstitutionTokens.hasTokens(sql), true);
|
||||
assert.strictEqual(SubstitutionTokens.hasTokens('select !bbox! from wadus'), true);
|
||||
assert.strictEqual(SubstitutionTokens.hasTokens('select !wadus! from wadus'), false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -36,24 +36,24 @@ describe('TableNameParser', function () {
|
||||
});
|
||||
|
||||
it('quotes identifiers that need quoting', function (done) {
|
||||
assert.equal(TableNameParser.quote('x yz'), '"x yz"');
|
||||
assert.equal(TableNameParser.quote('x-yz'), '"x-yz"');
|
||||
assert.equal(TableNameParser.quote('x.yz'), '"x.yz"');
|
||||
assert.strictEqual(TableNameParser.quote('x yz'), '"x yz"');
|
||||
assert.strictEqual(TableNameParser.quote('x-yz'), '"x-yz"');
|
||||
assert.strictEqual(TableNameParser.quote('x.yz'), '"x.yz"');
|
||||
done();
|
||||
});
|
||||
|
||||
it('doubles quotes', function (done) {
|
||||
assert.equal(TableNameParser.quote('x"yz'), '"x""yz"');
|
||||
assert.equal(TableNameParser.quote('x"y"z'), '"x""y""z"');
|
||||
assert.equal(TableNameParser.quote('x""y"z'), '"x""""y""z"');
|
||||
assert.equal(TableNameParser.quote('x "yz'), '"x ""yz"');
|
||||
assert.equal(TableNameParser.quote('x"y-y"z'), '"x""y-y""z"');
|
||||
assert.strictEqual(TableNameParser.quote('x"yz'), '"x""yz"');
|
||||
assert.strictEqual(TableNameParser.quote('x"y"z'), '"x""y""z"');
|
||||
assert.strictEqual(TableNameParser.quote('x""y"z'), '"x""""y""z"');
|
||||
assert.strictEqual(TableNameParser.quote('x "yz'), '"x ""yz"');
|
||||
assert.strictEqual(TableNameParser.quote('x"y-y"z'), '"x""y-y""z"');
|
||||
done();
|
||||
});
|
||||
|
||||
it('does not quote identifiers that don\'t need to be quoted', function (done) {
|
||||
assert.equal(TableNameParser.quote('xyz'), 'xyz');
|
||||
assert.equal(TableNameParser.quote('x_z123'), 'x_z123');
|
||||
assert.strictEqual(TableNameParser.quote('xyz'), 'xyz');
|
||||
assert.strictEqual(TableNameParser.quote('x_z123'), 'x_z123');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -88,7 +88,7 @@ describe('template_maps_auth', function () {
|
||||
it(testScenario.desc, function (done) {
|
||||
var debugMessage = testScenario.expected ? 'should be authorized' : 'unexpectedly authorized';
|
||||
var result = templateMaps.isAuthorized(testScenario.template, testScenario.token);
|
||||
assert.equal(result, testScenario.expected, debugMessage);
|
||||
assert.strictEqual(result, testScenario.expected, debugMessage);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -93,7 +93,7 @@ describe('template_maps', function () {
|
||||
templateMaps.addTemplate(owner, testScenario.template, function (err, templateId, template) {
|
||||
assert.ok(!err, 'Unexpected error adding template: ' + (err && err.message));
|
||||
assert.ok(testScenario.template !== template, 'template instances should be different');
|
||||
assert.equal(template.name, templateName);
|
||||
assert.strictEqual(template.name, templateName);
|
||||
assert.deepEqual(template.auth, testScenario.expected.auth);
|
||||
assert.deepEqual(template.placeholders, testScenario.expected.placeholders);
|
||||
|
||||
|
||||
@@ -237,7 +237,7 @@ describe('template_maps', function () {
|
||||
function addOmonimousTemplate (err, id) {
|
||||
assert.ifError(err);
|
||||
tpl_id = id;
|
||||
assert.equal(tpl_id, 'first');
|
||||
assert.strictEqual(tpl_id, 'first');
|
||||
expected_failure = true;
|
||||
// should fail, as it already exists
|
||||
tmap.addTemplate('me', tpl, this);
|
||||
@@ -284,7 +284,7 @@ describe('template_maps', function () {
|
||||
},
|
||||
function checkTemplates (err, ids) {
|
||||
assert.ifError(err);
|
||||
assert.equal(ids.length, 2);
|
||||
assert.strictEqual(ids.length, 2);
|
||||
assert.ok(ids.indexOf(tpl1_id) !== -1, ids.join(','));
|
||||
assert.ok(ids.indexOf(tpl2_id) !== -1, ids.join(','));
|
||||
return null;
|
||||
@@ -436,22 +436,22 @@ describe('template_maps', function () {
|
||||
var inst = tmap.instance(tpl1, {});
|
||||
|
||||
var lyr = inst.layers[0].options;
|
||||
assert.equal(lyr.sql, "select 'test' || id, g from t");
|
||||
assert.equal(lyr.cartocss, '#layer { marker-fill:red; marker-width: 23; }');
|
||||
assert.strictEqual(lyr.sql, "select 'test' || id, g from t");
|
||||
assert.strictEqual(lyr.cartocss, '#layer { marker-fill:red; marker-width: 23; }');
|
||||
|
||||
lyr = inst.layers[1].options;
|
||||
assert.equal(lyr.sql, "select fun('test') g from x");
|
||||
assert.equal(lyr.cartocss, '#layer { line-color:#a0fF9A; marker-fill:#a0fF9A; }');
|
||||
assert.strictEqual(lyr.sql, "select fun('test') g from x");
|
||||
assert.strictEqual(lyr.cartocss, '#layer { line-color:#a0fF9A; marker-fill:#a0fF9A; }');
|
||||
|
||||
inst = tmap.instance(tpl1, { color: 'yellow', name: "it's dangerous" });
|
||||
|
||||
lyr = inst.layers[0].options;
|
||||
assert.equal(lyr.sql, "select 'it''s dangerous' || id, g from t");
|
||||
assert.equal(lyr.cartocss, '#layer { marker-fill:red; marker-width: 23; }');
|
||||
assert.strictEqual(lyr.sql, "select 'it''s dangerous' || id, g from t");
|
||||
assert.strictEqual(lyr.cartocss, '#layer { marker-fill:red; marker-width: 23; }');
|
||||
|
||||
lyr = inst.layers[1].options;
|
||||
assert.equal(lyr.sql, "select fun('it''s dangerous') g from x");
|
||||
assert.equal(lyr.cartocss, '#layer { line-color:yellow; marker-fill:yellow; }');
|
||||
assert.strictEqual(lyr.sql, "select fun('it''s dangerous') g from x");
|
||||
assert.strictEqual(lyr.cartocss, '#layer { line-color:yellow; marker-fill:yellow; }');
|
||||
|
||||
// Invalid css_color
|
||||
var err = null;
|
||||
@@ -601,8 +601,8 @@ describe('template_maps', function () {
|
||||
|
||||
it('should emit on template update', function (done) {
|
||||
templateMaps.on('update', function (_owner, _templateName, _template) {
|
||||
assert.equal(_owner, owner);
|
||||
assert.equal(_templateName, templateName);
|
||||
assert.strictEqual(_owner, owner);
|
||||
assert.strictEqual(_templateName, templateName);
|
||||
assert.deepEqual(_template, templateUpdated);
|
||||
|
||||
templateMaps.delTemplate(owner, templateName, done);
|
||||
@@ -618,8 +618,8 @@ describe('template_maps', function () {
|
||||
|
||||
it('should emit on template deletion', function (done) {
|
||||
templateMaps.on('delete', function (_owner, _templateName) {
|
||||
assert.equal(_owner, owner);
|
||||
assert.equal(_templateName, templateName);
|
||||
assert.strictEqual(_owner, owner);
|
||||
assert.strictEqual(_templateName, templateName);
|
||||
|
||||
done();
|
||||
});
|
||||
@@ -634,8 +634,8 @@ describe('template_maps', function () {
|
||||
|
||||
it('should NOT emit on template update when template is the same', function (done) {
|
||||
templateMaps.on('update', function (_owner, _templateName, _template) {
|
||||
assert.equal(_owner, owner);
|
||||
assert.equal(_templateName, templateName);
|
||||
assert.strictEqual(_owner, owner);
|
||||
assert.strictEqual(_templateName, templateName);
|
||||
assert.deepEqual(_template, templateUpdated);
|
||||
|
||||
templateMaps.delTemplate(owner, templateName, done);
|
||||
|
||||
@@ -14,6 +14,6 @@ describe('date-wrapper', function () {
|
||||
"a","b c"
|
||||
FROM
|
||||
(select * from table) _cdb_epoch_transformation `;
|
||||
assert.equal(actual, expected);
|
||||
assert.strictEqual(actual, expected);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -95,7 +95,7 @@ describe('template_maps', function () {
|
||||
templateMaps.delTemplate(owner, templateName, done);
|
||||
} else {
|
||||
assert.ok(err);
|
||||
assert.equal(err.message, testScenario.expected.message);
|
||||
assert.strictEqual(err.message, testScenario.expected.message);
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user