diff --git a/test/acceptance/aggregation-test.js b/test/acceptance/aggregation-test.js index 00ee315d..b04dab98 100644 --- a/test/acceptance/aggregation-test.js +++ b/test/acceptance/aggregation-test.js @@ -333,7 +333,7 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); body.metadata.layers.forEach(layer => assert.ok(layer.meta.aggregation.mvt)); @@ -361,10 +361,10 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); - body.metadata.layers.forEach(layer => assert.equal(layer.meta.aggregation, undefined)); + body.metadata.layers.forEach(layer => assert.strictEqual(layer.meta.aggregation, undefined)); done(); }); @@ -397,7 +397,7 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); body.metadata.layers.forEach(layer => assert.ok(layer.meta.aggregation.mvt)); @@ -512,7 +512,7 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); body.metadata.layers.forEach(layer => assert.ok(layer.meta.aggregation.mvt)); @@ -561,7 +561,7 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); body.metadata.layers.forEach(layer => assert.ok(layer.meta.aggregation.mvt)); @@ -644,10 +644,10 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); - body.metadata.layers.forEach(layer => assert.equal(layer.meta.aggregation, undefined)); + body.metadata.layers.forEach(layer => assert.strictEqual(layer.meta.aggregation, undefined)); done(); }); @@ -683,11 +683,11 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); - assert.equal(body.metadata.layers[0].meta.aggregation.mvt, true); - assert.equal(body.metadata.layers[1].meta.aggregation.mvt, false); + assert.strictEqual(body.metadata.layers[0].meta.aggregation.mvt, true); + assert.strictEqual(body.metadata.layers[1].meta.aggregation.mvt, false); done(); }); @@ -713,11 +713,11 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); - assert.equal(body.metadata.layers[0].meta.aggregation.mvt, true); - assert.equal(body.metadata.layers[0].meta.aggregation.png, true); + assert.strictEqual(body.metadata.layers[0].meta.aggregation.mvt, true); + assert.strictEqual(body.metadata.layers[0].meta.aggregation.png, true); done(); }); @@ -743,11 +743,11 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); - assert.equal(body.metadata.layers[0].meta.aggregation.mvt, false); - assert.equal(body.metadata.layers[0].meta.aggregation.png, false); + assert.strictEqual(body.metadata.layers[0].meta.aggregation.mvt, false); + assert.strictEqual(body.metadata.layers[0].meta.aggregation.png, false); done(); }); @@ -822,7 +822,7 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); body.metadata.layers.forEach(layer => { @@ -903,7 +903,7 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); body.metadata.layers.forEach(layer => assert.ok(layer.meta.aggregation.mvt)); @@ -967,7 +967,7 @@ describe('aggregation', function () { const tileJSON = tile.toJSON(); - tileJSON[0].features.forEach(feature => assert.equal(typeof feature.properties.value, 'number')); + tileJSON[0].features.forEach(feature => assert.strictEqual(typeof feature.properties.value, 'number')); done(); }); @@ -1006,7 +1006,7 @@ describe('aggregation', function () { const tileJSON = tile.toJSON(); - tileJSON[0].features.forEach(feature => assert.equal(typeof feature.properties.dow, 'number')); + tileJSON[0].features.forEach(feature => assert.strictEqual(typeof feature.properties.dow, 'number')); done(); }); @@ -1120,7 +1120,7 @@ describe('aggregation', function () { return done(err); } const tileJSON = tile.toJSON(); - assert.equal(tileJSON[0].features.length, 3); + assert.strictEqual(tileJSON[0].features.length, 3); const resultQuimesters = tileJSON[0].features.map(f => f.properties.month).sort((a, b) => a - b); assert.deepEqual(resultQuimesters, [1, 2, 3]); @@ -1202,7 +1202,7 @@ describe('aggregation', function () { } const tileJSON = tile.toJSON(); // In UTC all times are in the same month 2018-01 - assert.equal(tileJSON[0].features.length, 1); + assert.strictEqual(tileJSON[0].features.length, 1); done(); }); @@ -1242,7 +1242,7 @@ describe('aggregation', function () { } const tileJSON = tile.toJSON(); // In UTC+2 some times are in a different month - assert.equal(tileJSON[0].features.length, 2); + assert.strictEqual(tileJSON[0].features.length, 2); done(); }); }); @@ -1473,7 +1473,7 @@ describe('aggregation', function () { '2018-01-01T22', '2018-01-01T23' ]); - tileJSON[0].features.forEach(f => assert.equal(f.properties._cdb_feature_count, 4)); + tileJSON[0].features.forEach(f => assert.strictEqual(f.properties._cdb_feature_count, 4)); done(); }); }); @@ -1508,7 +1508,7 @@ describe('aggregation', function () { const tileJSON = tile.toJSON(); tileJSON[0].features.forEach( - feature => assert.equal(typeof feature.properties.value, 'number') + feature => assert.strictEqual(typeof feature.properties.value, 'number') ); done(); @@ -1546,7 +1546,7 @@ describe('aggregation', function () { const tileJSON = tile.toJSON(); tileJSON[0].features.forEach( - feature => assert.equal(typeof feature.properties.value2, 'number') + feature => assert.strictEqual(typeof feature.properties.value2, 'number') ); done(); @@ -1582,10 +1582,10 @@ describe('aggregation', function () { const tileJSON = tile.toJSON(); tileJSON[0].features.forEach( - feature => assert.equal(typeof feature.properties.value, 'number') + feature => assert.strictEqual(typeof feature.properties.value, 'number') ); tileJSON[0].features.forEach( - feature => assert.equal(typeof feature.properties.sqrt_value, 'undefined') + feature => assert.strictEqual(typeof feature.properties.sqrt_value, 'undefined') ); done(); @@ -1623,10 +1623,10 @@ describe('aggregation', function () { const tileJSON = tile.toJSON(); tileJSON[0].features.forEach( - feature => assert.equal(typeof feature.properties.value, 'number') + feature => assert.strictEqual(typeof feature.properties.value, 'number') ); tileJSON[0].features.forEach( - feature => assert.equal(typeof feature.properties.sqrt_value, 'undefined') + feature => assert.strictEqual(typeof feature.properties.sqrt_value, 'undefined') ); done(); @@ -1666,7 +1666,7 @@ describe('aggregation', function () { const tileJSON = tile.toJSON(); tileJSON[0].features.forEach( - feature => assert.equal(typeof feature.properties.value, 'number') + feature => assert.strictEqual(typeof feature.properties.value, 'number') ); done(); @@ -1702,7 +1702,7 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); body.metadata.layers.forEach(layer => assert.ok(layer.meta.aggregation.mvt)); @@ -1744,7 +1744,7 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); body.metadata.layers.forEach(layer => assert.ok(layer.meta.aggregation.mvt)); @@ -1786,7 +1786,7 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); body.metadata.layers.forEach(layer => assert.ok(layer.meta.aggregation.mvt)); @@ -1828,7 +1828,7 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); body.metadata.layers.forEach(layer => assert.ok(layer.meta.aggregation.mvt)); @@ -2163,7 +2163,7 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); body.metadata.layers.forEach(layer => assert.ok(!layer.meta.aggregation.mvt)); @@ -2180,7 +2180,7 @@ describe('aggregation', function () { const tileJSON = tile.toJSON(); - assert.equal(tileJSON[0].features.length, 7); + assert.strictEqual(tileJSON[0].features.length, 7); done(); }); @@ -2214,11 +2214,11 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); - assert.equal(body.metadata.layers[0].meta.aggregation.mvt, false); - assert.equal(body.metadata.layers[1].meta.aggregation.mvt, true); + assert.strictEqual(body.metadata.layers[0].meta.aggregation.mvt, false); + assert.strictEqual(body.metadata.layers[1].meta.aggregation.mvt, true); const options = { format: 'mvt' @@ -2231,7 +2231,7 @@ describe('aggregation', function () { const tileJSON = tile.toJSON(); - assert.equal(tileJSON[0].features.length, 7); + assert.strictEqual(tileJSON[0].features.length, 7); done(); }); @@ -2262,7 +2262,7 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); body.metadata.layers.forEach(layer => assert.ok(layer.meta.aggregation.mvt)); @@ -2292,7 +2292,7 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); body.metadata.layers.forEach(layer => assert.ok(layer.meta.aggregation.mvt)); @@ -2329,7 +2329,7 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); body.metadata.layers.forEach(layer => assert.ok(layer.meta.aggregation.mvt)); @@ -2889,7 +2889,7 @@ describe('aggregation', function () { const tile2Ids = tile2.features.map(f => f.properties.cartodb_id); const repeatedIds = tile1Ids.filter(id => tile2Ids.includes(id)); - assert.equal(repeatedIds.length, 0); + assert.strictEqual(repeatedIds.length, 0); done(); }); @@ -2948,8 +2948,8 @@ describe('aggregation', function () { const tile1Features = tile1.features.filter(f => f.properties.cartodb_id === id); const tile2Features = tile2.features.filter(f => f.properties.cartodb_id === id); // repetitions cannot occur inside a tile - assert.equal(tile1Features.length, 1); - assert.equal(tile2Features.length, 1); + assert.strictEqual(tile1Features.length, 1); + assert.strictEqual(tile2Features.length, 1); const feature1 = tile1Features[0]; const feature2 = tile2Features[0]; // features should be identical (geometry and properties) @@ -2957,8 +2957,8 @@ describe('aggregation', function () { assert.deepEqual(feature1.geometry, feature2.geometry); // and geometry should be on the border; // for the dataset and zoom 1, only point with cartodb_id=4 (0,0) - assert.equal(feature1.properties.cartodb_id, 4); - assert.equal(feature2.properties.cartodb_id, 4); + assert.strictEqual(feature1.properties.cartodb_id, 4); + assert.strictEqual(feature2.properties.cartodb_id, 4); }); } done(); @@ -3024,7 +3024,7 @@ describe('aggregation', function () { const tile10Count = count_features(tile10); const tile01Count = count_features(tile01); const tile11Count = count_features(tile11); - assert.equal(13, tile00Count + tile10Count + tile01Count + tile11Count); + assert.strictEqual(13, tile00Count + tile10Count + tile01Count + tile11Count); done(); }); @@ -3178,7 +3178,7 @@ describe('aggregation', function () { const c1 = allFeatures[i]; const c2 = allFeatures[j]; if (c1.cartodb_id === c2.cartodb_id) { - assert.equal(c1._cdb_feature_count, c2._cdb_feature_count); + assert.strictEqual(c1._cdb_feature_count, c2._cdb_feature_count); } } } @@ -3217,8 +3217,8 @@ describe('aggregation', function () { return done(err); } const tile = JSON.parse(mvt.toGeoJSONSync(0)); - assert.equal(tile.features.length, 1); - assert.equal(tile.features[0].properties._cdb_feature_count, 4); + assert.strictEqual(tile.features.length, 1); + assert.strictEqual(tile.features[0].properties._cdb_feature_count, 4); if (placement === 'point-grid') { // check geometry x = 18181005.874444414, y = -18181043.94366749 const expectedPoint = [163.322754576802, -83.3823797469878]; @@ -3255,8 +3255,8 @@ describe('aggregation', function () { return done(err); } const tile = JSON.parse(mvt.toGeoJSONSync(0)); - assert.equal(tile.features.length, 1); - assert.equal(tile.features[0].properties._cdb_feature_count, 4); + assert.strictEqual(tile.features.length, 1); + assert.strictEqual(tile.features[0].properties._cdb_feature_count, 4); if (placement === 'point-grid') { // check geometry x = 18181006.023735486, y = -18181043.794376418 const expectedPoint = [163.322755917907, -83.3823795924354]; @@ -3295,7 +3295,7 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); assert.ok(body.metadata.layers[0].meta.aggregation.mvt); assert.ok(body.metadata.layers[0].meta.stats.estimatedFeatureCount > 0); @@ -3334,10 +3334,10 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); assert.ok(body.metadata.layers[0].meta.aggregation.mvt); - assert.equal(body.metadata.layers[0].meta.stats.aggrFeatureCount, 13); + assert.strictEqual(body.metadata.layers[0].meta.stats.aggrFeatureCount, 13); done(); }); @@ -3373,10 +3373,10 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); assert.ok(body.metadata.layers[0].meta.aggregation.mvt); - assert.equal(body.metadata.layers[0].meta.stats.aggrFeatureCount, 7); + assert.strictEqual(body.metadata.layers[0].meta.stats.aggrFeatureCount, 7); done(); }); @@ -3412,10 +3412,10 @@ describe('aggregation', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); assert.ok(body.metadata.layers[0].meta.aggregation.mvt); - assert.equal(body.metadata.layers[0].meta.stats.featureCount, 14); + assert.strictEqual(body.metadata.layers[0].meta.stats.featureCount, 14); done(); }); diff --git a/test/acceptance/analysis/analyses-controller-test.js b/test/acceptance/analysis/analyses-controller-test.js index 45bf3b01..3ea107cd 100644 --- a/test/acceptance/analysis/analyses-controller-test.js +++ b/test/acceptance/analysis/analyses-controller-test.js @@ -105,7 +105,7 @@ describe('analyses controller', function () { result.catalog .filter(analysis => analysis.node_id === '0a215e1f3405381cf0ea6b3b0deb6fdcfdc2fcaa') - .forEach(analysis => assert.equal(analysis.type, 'buffer')); + .forEach(analysis => assert.strictEqual(analysis.type, 'buffer')); this.testClient.drain(done); }); diff --git a/test/acceptance/analysis/analyses-filters-params-test.js b/test/acceptance/analysis/analyses-filters-params-test.js index a8c70424..9aabb26e 100644 --- a/test/acceptance/analysis/analyses-filters-params-test.js +++ b/test/acceptance/analysis/analyses-filters-params-test.js @@ -85,8 +85,8 @@ describe('analysis-filters-params', () => { testClient.getDataview('pop_max_histogram', testParams, (err, dataview) => { assert.ok(!err, err); - assert.equal(dataview.type, 'histogram'); - assert.equal(dataview.bins_count, 6); + assert.strictEqual(dataview.type, 'histogram'); + assert.strictEqual(dataview.bins_count, 6); testClient.drain(done); }); @@ -101,8 +101,8 @@ describe('analysis-filters-params', () => { testClient.getDataview('pop_max_histogram', testParams, (err, dataview) => { assert.ok(!err, err); - assert.equal(dataview.type, 'histogram'); - assert.equal(dataview.bins_count, 24); + assert.strictEqual(dataview.type, 'histogram'); + assert.strictEqual(dataview.bins_count, 24); testClient.drain(done); }); @@ -117,8 +117,8 @@ describe('analysis-filters-params', () => { testClient.getDataview('pop_max_histogram', testParams, (err, dataview) => { assert.ok(!err, err); - assert.equal(dataview.type, 'histogram'); - assert.equal(dataview.bins_count, 48); + assert.strictEqual(dataview.type, 'histogram'); + assert.strictEqual(dataview.bins_count, 48); testClient.drain(done); }); diff --git a/test/acceptance/analysis/analyses-filters-test.js b/test/acceptance/analysis/analyses-filters-test.js index 41e84653..b06723bd 100644 --- a/test/acceptance/analysis/analyses-filters-test.js +++ b/test/acceptance/analysis/analyses-filters-test.js @@ -76,8 +76,8 @@ describe('analysis-layers-dataviews', () => { testClient.getDataview('pop_max_histogram', params, (err, dataview) => { assert.ok(!err, err); - assert.equal(dataview.type, 'histogram'); - assert.equal(dataview.bins_start, 2008000); + assert.strictEqual(dataview.type, 'histogram'); + assert.strictEqual(dataview.bins_start, 2008000); testClient.drain(done); }); diff --git a/test/acceptance/analysis/analysis-layers-dataviews-test.js b/test/acceptance/analysis/analysis-layers-dataviews-test.js index 9d2d07b3..3f4a52d6 100644 --- a/test/acceptance/analysis/analysis-layers-dataviews-test.js +++ b/test/acceptance/analysis/analysis-layers-dataviews-test.js @@ -92,8 +92,8 @@ describe('analysis-layers-dataviews', function () { testClient.getDataview('pop_max_histogram', function (err, dataview) { assert.ok(!err, err); - assert.equal(dataview.type, 'histogram'); - assert.equal(dataview.bins_start, 0); + assert.strictEqual(dataview.type, 'histogram'); + assert.strictEqual(dataview.bins_start, 0); testClient.drain(done); }); @@ -116,8 +116,8 @@ describe('analysis-layers-dataviews', function () { testClient.getDataview('pop_max_histogram', params, function (err, dataview) { assert.ok(!err, err); - assert.equal(dataview.type, 'histogram'); - assert.equal(dataview.bins_start, 2008000); + assert.strictEqual(dataview.type, 'histogram'); + assert.strictEqual(dataview.bins_start, 2008000); testClient.drain(done); }); @@ -140,8 +140,8 @@ describe('analysis-layers-dataviews', function () { testClient.getDataview('pop_max_histogram', params, function (err, dataview) { assert.ok(!err, err); - assert.equal(dataview.type, 'histogram'); - assert.equal(dataview.bins_start, 0); + assert.strictEqual(dataview.type, 'histogram'); + assert.strictEqual(dataview.bins_start, 0); testClient.drain(done); }); diff --git a/test/acceptance/analysis/analysis-layers-test.js b/test/acceptance/analysis/analysis-layers-test.js index ef111471..dc082b31 100644 --- a/test/acceptance/analysis/analysis-layers-test.js +++ b/test/acceptance/analysis/analysis-layers-test.js @@ -154,7 +154,7 @@ describe('analysis-layers', function () { testClient.getLayergroup(function (err, layergroupResult) { assert.ok(!err, err); - assert.equal(layergroupResult.metadata.layers.length, 1); + assert.strictEqual(layergroupResult.metadata.layers.length, 1); testClient.drain(done); }); @@ -198,7 +198,7 @@ describe('analysis-layers', function () { 'Missing "analyses" array metadata from: ' + JSON.stringify(layergroupResult) ); var analyses = layergroupResult.metadata.analyses; - assert.equal(analyses.length, 1, 'Invalid number of analyses in metadata'); + assert.strictEqual(analyses.length, 1, 'Invalid number of analyses in metadata'); var nodes = analyses[0].nodes; var nodesIds = Object.keys(nodes); assert.deepEqual(nodesIds, ['HEAD', '2570e105-7b37-40d2-bdf4-1af889598745']); @@ -288,7 +288,7 @@ describe('analysis-layers', function () { 'Missing "analyses" array metadata from: ' + JSON.stringify(layergroupResult) ); var analyses = layergroupResult.metadata.analyses; - assert.equal(analyses.length, 1, 'Invalid number of analyses in metadata'); + assert.strictEqual(analyses.length, 1, 'Invalid number of analyses in metadata'); var nodes = analyses[0].nodes; var nodesIds = Object.keys(nodes); @@ -313,11 +313,11 @@ describe('analysis-layers', function () { testClient.getNodeStatus('HEAD', function (err, response, nodeStatus) { assert.ok(!err, err); - assert.equal(nodeStatus.status, 'ready'); + assert.strictEqual(nodeStatus.status, 'ready'); var headers = response.headers; - assert.equal(headers['cache-control'], 'public,max-age=5'); + assert.strictEqual(headers['cache-control'], 'public,max-age=5'); var lastModified = new Date(headers['last-modified']); var tenSecondsInMs = 1e5; diff --git a/test/acceptance/analysis/analysis-layers-use-cases-test.js b/test/acceptance/analysis/analysis-layers-use-cases-test.js index 7b6f4037..7fde6bb3 100644 --- a/test/acceptance/analysis/analysis-layers-use-cases-test.js +++ b/test/acceptance/analysis/analysis-layers-use-cases-test.js @@ -277,7 +277,7 @@ describe('analysis-layers use cases', function () { // image.save('/tmp/tests/' + imageIdx + '---' + useCase.desc.replace(/\s/g, '-') + '.png'); - assert.equal(image.width(), 256); + assert.strictEqual(image.width(), 256); testClient.drain(done); }); diff --git a/test/acceptance/analysis/error-cases-test.js b/test/acceptance/analysis/error-cases-test.js index 3eeb9fd9..fe30fe79 100644 --- a/test/acceptance/analysis/error-cases-test.js +++ b/test/acceptance/analysis/error-cases-test.js @@ -67,8 +67,8 @@ describe('analysis-layers error cases', function () { testClient.getLayergroup({ response: ERROR_RESPONSE }, function (err, layergroupResult) { assert.ok(!err, err); - assert.equal(layergroupResult.errors.length, 1); - assert.equal(layergroupResult.errors[0], 'Missing analysis node.id="INVALID-SOURCE-ID" for layer=0'); + assert.strictEqual(layergroupResult.errors.length, 1); + assert.strictEqual(layergroupResult.errors[0], 'Missing analysis node.id="INVALID-SOURCE-ID" for layer=0'); testClient.drain(done); }); @@ -102,8 +102,8 @@ describe('analysis-layers error cases', function () { testClient.getLayergroup({ response: ERROR_RESPONSE }, function (err, layergroupResult) { assert.ok(!err, err); - assert.equal(layergroupResult.errors.length, 1); - assert.equal( + assert.strictEqual(layergroupResult.errors.length, 1); + assert.strictEqual( layergroupResult.errors[0], 'Missing analysis node.id="ID-FOR-NONEXISTENT-ANALYSIS" for layer=1' ); @@ -149,8 +149,8 @@ describe('analysis-layers error cases', function () { testClient.getLayergroup({ response: ERROR_RESPONSE }, function (err, layergroupResult) { assert.ok(!err, err); - assert.equal(layergroupResult.errors.length, 1); - assert.equal(layergroupResult.errors[0], 'Node with `source.id="ID-FOR-NONEXISTENT-ANALYSIS"`' + + assert.strictEqual(layergroupResult.errors.length, 1); + assert.strictEqual(layergroupResult.errors[0], 'Node with `source.id="ID-FOR-NONEXISTENT-ANALYSIS"`' + ' not found in analyses for dataview "pop_max_histogram"'); testClient.drain(done); @@ -195,19 +195,19 @@ describe('analysis-layers error cases', function () { testClient.getLayergroup({ response: AUTH_ERROR_RESPONSE }, function (err, layergroupResult) { assert.ok(!err, err); - assert.equal(layergroupResult.errors.length, 1); - assert.equal( + assert.strictEqual(layergroupResult.errors.length, 1); + assert.strictEqual( layergroupResult.errors[0], 'Analysis requires authentication with API key: permission denied.' ); - assert.equal(layergroupResult.errors_with_context[0].type, 'analysis'); - assert.equal( + assert.strictEqual(layergroupResult.errors_with_context[0].type, 'analysis'); + assert.strictEqual( layergroupResult.errors_with_context[0].message, 'Analysis requires authentication with API key: permission denied.' ); - assert.equal(layergroupResult.errors_with_context[0].analysis.id, 'HEAD'); - assert.equal(layergroupResult.errors_with_context[0].analysis.type, 'buffer'); + assert.strictEqual(layergroupResult.errors_with_context[0].analysis.id, 'HEAD'); + assert.strictEqual(layergroupResult.errors_with_context[0].analysis.type, 'buffer'); testClient.drain(done); }); @@ -250,16 +250,16 @@ describe('analysis-layers error cases', function () { testClient.getLayergroup({ response: ERROR_RESPONSE }, function (err, layergroupResult) { assert.ok(!err, err); - assert.equal(layergroupResult.errors.length, 1); - assert.equal( + assert.strictEqual(layergroupResult.errors.length, 1); + assert.strictEqual( layergroupResult.errors[0], 'Missing required param "radius"' ); - assert.equal(layergroupResult.errors_with_context[0].type, 'analysis'); - assert.equal(layergroupResult.errors_with_context[0].message, 'Missing required param "radius"'); - assert.equal(layergroupResult.errors_with_context[0].analysis.id, 'HEAD'); - assert.equal(layergroupResult.errors_with_context[0].analysis.type, 'buffer'); + assert.strictEqual(layergroupResult.errors_with_context[0].type, 'analysis'); + assert.strictEqual(layergroupResult.errors_with_context[0].message, 'Missing required param "radius"'); + assert.strictEqual(layergroupResult.errors_with_context[0].analysis.id, 'HEAD'); + assert.strictEqual(layergroupResult.errors_with_context[0].analysis.type, 'buffer'); testClient.drain(done); }); @@ -302,17 +302,17 @@ describe('analysis-layers error cases', function () { testClient.getLayergroup({ response: ERROR_RESPONSE }, function (err, layergroupResult) { assert.ok(!err, err); - assert.equal(layergroupResult.errors.length, 1); - assert.equal( + assert.strictEqual(layergroupResult.errors.length, 1); + assert.strictEqual( layergroupResult.errors[0], 'Missing required param "radius"' ); - assert.equal(layergroupResult.errors_with_context[0].type, 'analysis'); - assert.equal(layergroupResult.errors_with_context[0].message, 'Missing required param "radius"'); - assert.equal(layergroupResult.errors_with_context[0].analysis.id, 'HEAD'); - assert.equal(layergroupResult.errors_with_context[0].analysis.type, 'buffer'); - assert.equal(layergroupResult.errors_with_context[0].analysis.node_id, 'HEAD'); + assert.strictEqual(layergroupResult.errors_with_context[0].type, 'analysis'); + assert.strictEqual(layergroupResult.errors_with_context[0].message, 'Missing required param "radius"'); + assert.strictEqual(layergroupResult.errors_with_context[0].analysis.id, 'HEAD'); + assert.strictEqual(layergroupResult.errors_with_context[0].analysis.type, 'buffer'); + assert.strictEqual(layergroupResult.errors_with_context[0].analysis.node_id, 'HEAD'); testClient.drain(done); }); @@ -355,20 +355,20 @@ describe('analysis-layers error cases', function () { testClient.getLayergroup({ response: ERROR_RESPONSE }, function (err, layergroupResult) { assert.ok(!err, err); - assert.equal(layergroupResult.errors.length, 1); - assert.equal( + assert.strictEqual(layergroupResult.errors.length, 1); + assert.strictEqual( layergroupResult.errors[0], 'Invalid type for param "radius", expects "number" type, got `"invalid_radius"`' ); - assert.equal(layergroupResult.errors_with_context[0].type, 'analysis'); - assert.equal( + assert.strictEqual(layergroupResult.errors_with_context[0].type, 'analysis'); + assert.strictEqual( layergroupResult.errors_with_context[0].message, 'Invalid type for param "radius", expects "number" type, got `"invalid_radius"`' ); - assert.equal(layergroupResult.errors_with_context[0].analysis.id, 'HEAD'); - assert.equal(layergroupResult.errors_with_context[0].analysis.type, 'buffer'); - assert.equal(layergroupResult.errors_with_context[0].analysis.node_id, 'HEAD2'); + assert.strictEqual(layergroupResult.errors_with_context[0].analysis.id, 'HEAD'); + assert.strictEqual(layergroupResult.errors_with_context[0].analysis.type, 'buffer'); + assert.strictEqual(layergroupResult.errors_with_context[0].analysis.node_id, 'HEAD2'); testClient.drain(done); }); @@ -419,20 +419,20 @@ describe('analysis-layers error cases', function () { testClient.getLayergroup({ response: ERROR_RESPONSE }, function (err, layergroupResult) { assert.ok(!err, err); - assert.equal(layergroupResult.errors.length, 1); - assert.equal( + assert.strictEqual(layergroupResult.errors.length, 1); + assert.strictEqual( layergroupResult.errors[0], 'function dep_ext_does_not_exist_fn(unknown, unknown, unknown, text[], unknown) does not exist' ); - assert.equal(layergroupResult.errors_with_context[0].type, 'analysis'); - assert.equal( + assert.strictEqual(layergroupResult.errors_with_context[0].type, 'analysis'); + assert.strictEqual( layergroupResult.errors_with_context[0].message, 'function dep_ext_does_not_exist_fn(unknown, unknown, unknown, text[], unknown) does not exist' ); - assert.equal(layergroupResult.errors_with_context[0].analysis.id, 'HEAD'); - assert.equal(layergroupResult.errors_with_context[0].analysis.type, 'buffer'); - assert.equal(layergroupResult.errors_with_context[0].analysis.node_id, 'HEAD3'); + assert.strictEqual(layergroupResult.errors_with_context[0].analysis.id, 'HEAD'); + assert.strictEqual(layergroupResult.errors_with_context[0].analysis.type, 'buffer'); + assert.strictEqual(layergroupResult.errors_with_context[0].analysis.node_id, 'HEAD3'); testClient.drain(done); }); diff --git a/test/acceptance/analysis/named-maps-test.js b/test/acceptance/analysis/named-maps-test.js index 82e538eb..81d74d71 100644 --- a/test/acceptance/analysis/named-maps-test.js +++ b/test/acceptance/analysis/named-maps-test.js @@ -144,7 +144,7 @@ describe('named-maps analysis', function () { 'Missing "analyses" array metadata from: ' + res.body ); var analyses = layergroup.metadata.analyses; - assert.equal(analyses.length, 1, 'Invalid number of analyses in metadata'); + assert.strictEqual(analyses.length, 1, 'Invalid number of analyses in metadata'); var nodes = analyses[0].nodes; var nodesIds = Object.keys(nodes); assert.deepEqual(nodesIds, ['HEAD', '2570e105-7b37-40d2-bdf4-1af889598745']); @@ -220,8 +220,8 @@ describe('named-maps analysis', function () { } var dataview = JSON.parse(res.body); - assert.equal(dataview.type, 'histogram'); - assert.equal(dataview.bins_start, 0); + assert.strictEqual(dataview.type, 'histogram'); + assert.strictEqual(dataview.bins_start, 0); done(); } diff --git a/test/acceptance/analysis/regressions-test.js b/test/acceptance/analysis/regressions-test.js index bcc1ed3f..08f3353f 100644 --- a/test/acceptance/analysis/regressions-test.js +++ b/test/acceptance/analysis/regressions-test.js @@ -99,7 +99,7 @@ describe('analysis-layers regressions', function () { assert.ok(layergroupResult.metadata); var analyses = layergroupResult.metadata.analyses; assert.ok(analyses); - assert.equal(analyses.length, 1); + assert.strictEqual(analyses.length, 1); var expectedIds = ['customer_home_locations', 'b0', 'b1', 'a2', 'a3', 'a4']; expectedIds.forEach(function (expectedId) { @@ -108,7 +108,7 @@ describe('analysis-layers regressions', function () { 'Missing "' + expectedId + '" from node list.' ); }); - assert.equal(Object.keys(analyses[0].nodes).length, expectedIds.length, Object.keys(analyses[0].nodes)); + assert.strictEqual(Object.keys(analyses[0].nodes).length, expectedIds.length, Object.keys(analyses[0].nodes)); testClient.drain(done); }); diff --git a/test/acceptance/auth/authorization-basic-use-cases-test.js b/test/acceptance/auth/authorization-basic-use-cases-test.js index e02504e9..4d54a03d 100644 --- a/test/acceptance/auth/authorization-basic-use-cases-test.js +++ b/test/acceptance/auth/authorization-basic-use-cases-test.js @@ -71,7 +71,7 @@ describe('Basic authorization use cases', function () { var parsed = JSON.parse(res.body); assert.ok(parsed.layergroupid); - assert.equal(res.headers['x-layergroup-id'], parsed.layergroupid); + assert.strictEqual(res.headers['x-layergroup-id'], parsed.layergroupid); keysToDelete['map_cfg|' + LayergroupToken.parse(parsed.layergroupid).token] = 0; keysToDelete['user:localhost:mapviews:global'] = 5; @@ -94,7 +94,7 @@ describe('Basic authorization use cases', function () { var parsed = JSON.parse(res.body); assert.ok(parsed.layergroupid); - assert.equal(res.headers['x-layergroup-id'], parsed.layergroupid); + assert.strictEqual(res.headers['x-layergroup-id'], parsed.layergroupid); keysToDelete['map_cfg|' + LayergroupToken.parse(parsed.layergroupid).token] = 0; keysToDelete['user:localhost:mapviews:global'] = 5; @@ -116,7 +116,7 @@ describe('Basic authorization use cases', function () { assert.ifError(err); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('errors')); - assert.equal(parsed.errors.length, 1); + assert.strictEqual(parsed.errors.length, 1); assert.ok(parsed.errors[0].match(/Unauthorized/)); done(); } @@ -153,7 +153,7 @@ describe('Basic authorization use cases', function () { var parsed = JSON.parse(res.body); assert.ok(parsed.layergroupid); - assert.equal(res.headers['x-layergroup-id'], parsed.layergroupid); + assert.strictEqual(res.headers['x-layergroup-id'], parsed.layergroupid); keysToDelete['map_cfg|' + LayergroupToken.parse(parsed.layergroupid).token] = 0; keysToDelete['user:localhost:mapviews:global'] = 5; diff --git a/test/acceptance/auth/authorization-test.js b/test/acceptance/auth/authorization-test.js index 21bca5a7..ab8e37ee 100644 --- a/test/acceptance/auth/authorization-test.js +++ b/test/acceptance/auth/authorization-test.js @@ -71,7 +71,7 @@ describe('authorization', function () { assert.ifError(err); assert.ok(body.hasOwnProperty('errors')); - assert.equal(body.errors.length, 1); + assert.strictEqual(body.errors.length, 1); assert.ok(body.errors[0].match(/permission denied/), body.errors[0]); testClientGet.drain(done); @@ -99,7 +99,7 @@ describe('authorization', function () { assert.ifError(err); assert.ok(layergroupResult.hasOwnProperty('errors')); - assert.equal(layergroupResult.errors.length, 1); + assert.strictEqual(layergroupResult.errors.length, 1); assert.ok(layergroupResult.errors[0].match(/permission denied/), layergroupResult.errors[0]); testClient.drain(done); @@ -150,7 +150,7 @@ describe('authorization', function () { testClient.getTile(0, 0, 0, function (err, res, tile) { assert.ifError(err); - assert.equal(res.statusCode, 200); + assert.strictEqual(res.statusCode, 200); assert.ok(tile instanceof mapnik.Image); testClient.drain(done); @@ -176,7 +176,7 @@ describe('authorization', function () { assert.ifError(err); assert.ok(layergroupResult.hasOwnProperty('errors')); - assert.equal(layergroupResult.errors.length, 1); + assert.strictEqual(layergroupResult.errors.length, 1); assert.ok(layergroupResult.errors[0].match(/permission denied/), layergroupResult.errors[0]); testClient.drain(done); @@ -203,7 +203,7 @@ describe('authorization', function () { assert.ifError(err); assert.ok(layergroupResult.hasOwnProperty('errors')); - assert.equal(layergroupResult.errors.length, 1); + assert.strictEqual(layergroupResult.errors.length, 1); assert.ok(layergroupResult.errors[0].match(/Forbidden/), layergroupResult.errors[0]); testClient.drain(done); @@ -339,9 +339,9 @@ describe('authorization', function () { testClient.getNamedMapList({ response: { status: 403 } }, function (err, res, body) { assert.ifError(err); - assert.equal(res.statusCode, 403); + assert.strictEqual(res.statusCode, 403); - assert.equal(body.errors.length, 1); + assert.strictEqual(body.errors.length, 1); assert.ok(body.errors[0].match(/Forbidden/), body.errors[0]); testClient.drain(done); @@ -356,9 +356,9 @@ describe('authorization', function () { testClient.getNamedMapList({ response: { status: 403 } }, function (err, res, body) { assert.ifError(err); - assert.equal(res.statusCode, 403); + assert.strictEqual(res.statusCode, 403); - assert.equal(body.errors.length, 1); + assert.strictEqual(body.errors.length, 1); assert.ok(body.errors[0].match(/Forbidden/), body.errors[0]); testClient.drain(done); @@ -373,9 +373,9 @@ describe('authorization', function () { testClient.getNamedMapList({ response: { status: 401 } }, function (err, res, body) { assert.ifError(err); - assert.equal(res.statusCode, 401); + assert.strictEqual(res.statusCode, 401); - assert.equal(body.errors.length, 1); + assert.strictEqual(body.errors.length, 1); assert.ok(body.errors[0].match(/Unauthorized/), body.errors[0]); testClient.drain(done); @@ -390,7 +390,7 @@ describe('authorization', function () { testClient.getNamedMapList({}, function (err, res, body) { assert.ifError(err); - assert.equal(res.statusCode, 200); + assert.strictEqual(res.statusCode, 200); assert.ok(Array.isArray(body.template_ids)); testClient.drain(done); @@ -429,7 +429,7 @@ describe('authorization', function () { testClient.getTile(0, 0, 0, function (err, res, tile) { assert.ifError(err); - assert.equal(res.statusCode, 200); + assert.strictEqual(res.statusCode, 200); assert.ok(tile instanceof mapnik.Image); testClient.drain(done); @@ -444,9 +444,9 @@ describe('authorization', function () { testClient.createTemplate({ response: { status: 403 } }, function (err, res, response) { assert.ifError(err); - assert.equal(res.statusCode, 403); + assert.strictEqual(res.statusCode, 403); - assert.equal(response.errors.length, 1); + assert.strictEqual(response.errors.length, 1); assert.ok(response.errors[0].match(/Forbidden/), response.errors[0]); testClient.drain(done); @@ -461,9 +461,9 @@ describe('authorization', function () { testClient.createTemplate({ response: { status: 403 } }, function (err, res, response) { assert.ifError(err); - assert.equal(res.statusCode, 403); + assert.strictEqual(res.statusCode, 403); - assert.equal(response.errors.length, 1); + assert.strictEqual(response.errors.length, 1); assert.ok(response.errors[0].match(/Forbidden/), response.errors[0]); testClient.drain(done); @@ -478,9 +478,9 @@ describe('authorization', function () { testClient.createTemplate({ response: { status: 401 } }, function (err, res, response) { assert.ifError(err); - assert.equal(res.statusCode, 401); + assert.strictEqual(res.statusCode, 401); - assert.equal(response.errors.length, 1); + assert.strictEqual(response.errors.length, 1); assert.ok(response.errors[0].match(/Unauthorized/), response.errors[0]); testClient.drain(done); @@ -531,7 +531,7 @@ describe('authorization', function () { function (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 204); + assert.strictEqual(res.statusCode, 204); testClientDelete.drain(done); } @@ -559,9 +559,9 @@ describe('authorization', function () { function (err, res, response) { assert.ifError(err); - assert.equal(res.statusCode, 403); + assert.strictEqual(res.statusCode, 403); - assert.equal(response.errors.length, 1); + assert.strictEqual(response.errors.length, 1); assert.ok(response.errors[0].match(/Forbidden/), response.errors[0]); testClientDelete.drain(done); @@ -590,9 +590,9 @@ describe('authorization', function () { function (err, res, response) { assert.ifError(err); - assert.equal(res.statusCode, 403); + assert.strictEqual(res.statusCode, 403); - assert.equal(response.errors.length, 1); + assert.strictEqual(response.errors.length, 1); assert.ok(response.errors[0].match(/Forbidden/), response.errors[0]); testClientDelete.drain(done); @@ -621,9 +621,9 @@ describe('authorization', function () { function (err, res, response) { assert.ifError(err); - assert.equal(res.statusCode, 401); + assert.strictEqual(res.statusCode, 401); - assert.equal(response.errors.length, 1); + assert.strictEqual(response.errors.length, 1); assert.ok(response.errors[0].match(/Unauthorized/), response.errors[0]); testClientDelete.drain(done); @@ -676,7 +676,7 @@ describe('authorization', function () { function (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200); + assert.strictEqual(res.statusCode, 200); testClientDelete.drain(done); } @@ -704,9 +704,9 @@ describe('authorization', function () { function (err, res, response) { assert.ifError(err); - assert.equal(res.statusCode, 403); + assert.strictEqual(res.statusCode, 403); - assert.equal(response.errors.length, 1); + assert.strictEqual(response.errors.length, 1); assert.ok(response.errors[0].match(/Forbidden/), response.errors[0]); testClientGet.drain(done); @@ -735,9 +735,9 @@ describe('authorization', function () { function (err, res, response) { assert.ifError(err); - assert.equal(res.statusCode, 403); + assert.strictEqual(res.statusCode, 403); - assert.equal(response.errors.length, 1); + assert.strictEqual(response.errors.length, 1); assert.ok(response.errors[0].match(/Forbidden/), response.errors[0]); testClientGet.drain(done); @@ -766,9 +766,9 @@ describe('authorization', function () { function (err, res, response) { assert.ifError(err); - assert.equal(res.statusCode, 401); + assert.strictEqual(res.statusCode, 401); - assert.equal(response.errors.length, 1); + assert.strictEqual(response.errors.length, 1); assert.ok(response.errors[0].match(/Unauthorized/), response.errors[0]); testClientGet.drain(done); @@ -822,7 +822,7 @@ describe('authorization', function () { function (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200); + assert.strictEqual(res.statusCode, 200); testClientDelete.drain(done); } @@ -851,9 +851,9 @@ describe('authorization', function () { function (err, res, response) { assert.ifError(err); - assert.equal(res.statusCode, 403); + assert.strictEqual(res.statusCode, 403); - assert.equal(response.errors.length, 1); + assert.strictEqual(response.errors.length, 1); assert.ok(response.errors[0].match(/Forbidden/), response.errors[0]); testClientDelete.drain(done); @@ -883,9 +883,9 @@ describe('authorization', function () { function (err, res, response) { assert.ifError(err); - assert.equal(res.statusCode, 403); + assert.strictEqual(res.statusCode, 403); - assert.equal(response.errors.length, 1); + assert.strictEqual(response.errors.length, 1); assert.ok(response.errors[0].match(/Forbidden/), response.errors[0]); testClientDelete.drain(done); @@ -915,9 +915,9 @@ describe('authorization', function () { function (err, res, response) { assert.ifError(err); - assert.equal(res.statusCode, 401); + assert.strictEqual(res.statusCode, 401); - assert.equal(response.errors.length, 1); + assert.strictEqual(response.errors.length, 1); assert.ok(response.errors[0].match(/Unauthorized/), response.errors[0]); testClientDelete.drain(done); diff --git a/test/acceptance/buffer-size-format-test.js b/test/acceptance/buffer-size-format-test.js index 7b2c843b..1a5e653a 100644 --- a/test/acceptance/buffer-size-format-test.js +++ b/test/acceptance/buffer-size-format-test.js @@ -88,7 +88,7 @@ describe('buffer size per format', function () { assert: function (tile, callback) { var tileJSON = tile.toJSON(); var features = tileJSON[0].features; - assert.equal(features.length, 1); + assert.strictEqual(features.length, 1); callback(); } }, @@ -101,7 +101,7 @@ describe('buffer size per format', function () { assert: function (tile, callback) { var tileJSON = tile.toJSON(); var features = tileJSON[0].features; - assert.equal(features.length, 9); + assert.strictEqual(features.length, 9); callback(); } }, @@ -377,7 +377,7 @@ describe('buffer size per format for named maps w/o placeholders', function () { var vtileJSON = vtile.toJSON(); var vtileFeatures = vtileJSON[0].features; - assert.equal(features.length, vtileFeatures.length); + assert.strictEqual(features.length, vtileFeatures.length); callback(); } }, @@ -402,7 +402,7 @@ describe('buffer size per format for named maps w/o placeholders', function () { var vtileJSON = vtile.toJSON(); var vtileFeatures = vtileJSON[0].features; - assert.equal(features.length, vtileFeatures.length); + assert.strictEqual(features.length, vtileFeatures.length); callback(); } }, diff --git a/test/acceptance/cache/cache-control-header-test.js b/test/acceptance/cache/cache-control-header-test.js index 5a9f94f1..62a214bc 100644 --- a/test/acceptance/cache/cache-control-header-test.js +++ b/test/acceptance/cache/cache-control-header-test.js @@ -54,7 +54,7 @@ describe('cache-control header', function () { return done(err); } - assert.equal(res.headers['cache-control'], `public,max-age=${ttl}`); + assert.strictEqual(res.headers['cache-control'], `public,max-age=${ttl}`); testClient.drain(done); }); }); @@ -140,7 +140,7 @@ describe('cache-control header', function () { return done(err); } - assert.equal(res.headers['cache-control'], `public,max-age=${ttl}`); + assert.strictEqual(res.headers['cache-control'], `public,max-age=${ttl}`); testClient.drain(done); }); }); @@ -181,7 +181,7 @@ describe('cache-control header', function () { return done(err); } - assert.equal(res.headers['cache-control'], `public,max-age=${ttl}`); + assert.strictEqual(res.headers['cache-control'], `public,max-age=${ttl}`); testClient.drain(done); }); }); diff --git a/test/acceptance/cache/cache-headers-test.js b/test/acceptance/cache/cache-headers-test.js index 3156a65c..ac69ee34 100644 --- a/test/acceptance/cache/cache-headers-test.js +++ b/test/acceptance/cache/cache-headers-test.js @@ -161,10 +161,10 @@ describe('get requests with cache headers', function () { assert.ok(res.headers['x-cache-channel']); assert.ok(res.headers['surrogate-key']); - assert.equal(res.headers.vary, 'Authorization'); + assert.strictEqual(res.headers.vary, 'Authorization'); if (expectedCacheHeaders) { validateXChannelHeaders(res.headers, expectedCacheHeaders); - assert.equal(res.headers['surrogate-key'], expectedCacheHeaders.surrogate_keys); + assert.strictEqual(res.headers['surrogate-key'], expectedCacheHeaders.surrogate_keys); } done(); @@ -174,7 +174,7 @@ describe('get requests with cache headers', function () { function validateXChannelHeaders (headers, expectedCacheHeaders) { var dbName = headers['x-cache-channel'].split(':')[0]; var tables = headers['x-cache-channel'].split(':')[1].split(',').sort(); - assert.equal(dbName, expectedCacheHeaders.x_cache_channel.db_name); + assert.strictEqual(dbName, expectedCacheHeaders.x_cache_channel.db_name); assert.deepEqual(tables, expectedCacheHeaders.x_cache_channel.tables.sort()); } diff --git a/test/acceptance/cache/surrogate-keys-invalidation-test.js b/test/acceptance/cache/surrogate-keys-invalidation-test.js index f092f177..a06a96ef 100644 --- a/test/acceptance/cache/surrogate-keys-invalidation-test.js +++ b/test/acceptance/cache/surrogate-keys-invalidation-test.js @@ -182,8 +182,8 @@ describe('templates surrogate keys', function () { var parsedBody = JSON.parse(res.body); assert.deepEqual(parsedBody, expectedBody); - assert.equal(scope.pendingMocks().length, 0); - assert.equal(fastlyScope.pendingMocks().length, 0); + assert.strictEqual(scope.pendingMocks().length, 0); + assert.strictEqual(fastlyScope.pendingMocks().length, 0); return null; }, @@ -244,8 +244,8 @@ describe('templates surrogate keys', function () { throw err; } - assert.equal(scope.pendingMocks().length, 0); - assert.equal(fastlyScope.pendingMocks().length, 0); + assert.strictEqual(scope.pendingMocks().length, 0); + assert.strictEqual(fastlyScope.pendingMocks().length, 0); return null; }, @@ -306,8 +306,8 @@ describe('templates surrogate keys', function () { var parsedBody = JSON.parse(res.body); assert.deepEqual(parsedBody, expectedBody); - assert.equal(scope.pendingMocks().length, 0); - assert.equal(fastlyScope.pendingMocks().length, 0); + assert.strictEqual(scope.pendingMocks().length, 0); + assert.strictEqual(fastlyScope.pendingMocks().length, 0); return null; }, diff --git a/test/acceptance/custom-middlewares-test.js b/test/acceptance/custom-middlewares-test.js index fbd8ee72..6d042cb5 100644 --- a/test/acceptance/custom-middlewares-test.js +++ b/test/acceptance/custom-middlewares-test.js @@ -79,7 +79,7 @@ describe('custom middlewares', function () { return done(err); } - assert.equal(res.body, 'I\'m a teapot'); + assert.strictEqual(res.body, 'I\'m a teapot'); done(); }); @@ -109,7 +109,7 @@ describe('custom middlewares', function () { return done(err); } - assert.equal(res.body, 'I\'m a teapot'); + assert.strictEqual(res.body, 'I\'m a teapot'); done(); }); @@ -217,7 +217,7 @@ describe('custom middlewares', function () { return done(err); } - assert.equal(res.body, 'I\'m a teapot'); + assert.strictEqual(res.body, 'I\'m a teapot'); done(); }); @@ -290,7 +290,7 @@ describe('custom middlewares', function () { return done(err); } - assert.equal(res.body, 'I\'m a teapot'); + assert.strictEqual(res.body, 'I\'m a teapot'); done(); }); diff --git a/test/acceptance/dataviews/aggregation-test.js b/test/acceptance/dataviews/aggregation-test.js index fda30581..6e541018 100644 --- a/test/acceptance/dataviews/aggregation-test.js +++ b/test/acceptance/dataviews/aggregation-test.js @@ -54,8 +54,8 @@ describe('aggregations happy cases', function () { assert.ok(!err, err); assert.ok(aggregation); - assert.equal(aggregation.type, 'aggregation'); - assert.equal(aggregation.aggregation, operation); + assert.strictEqual(aggregation.type, 'aggregation'); + assert.strictEqual(aggregation.aggregation, operation); done(); }); @@ -79,11 +79,11 @@ describe('aggregations happy cases', function () { assert.ifError(err); assert.ok(aggregation); - assert.equal(aggregation.type, 'aggregation'); + assert.strictEqual(aggregation.type, 'aggregation'); assert.ok(aggregation.categories); - assert.equal(aggregation.categoriesCount, 3); - assert.equal(aggregation.count, 4); - assert.equal(aggregation.nulls, 1); + assert.strictEqual(aggregation.categoriesCount, 3); + assert.strictEqual(aggregation.count, 4); + assert.strictEqual(aggregation.nulls, 1); var hasNullCategory = false; aggregation.categories.forEach(function (category) { @@ -120,17 +120,17 @@ describe('aggregations happy cases', function () { assert.ifError(err); assert.ok(aggregation); - assert.equal(aggregation.type, 'aggregation'); + assert.strictEqual(aggregation.type, 'aggregation'); assert.ok(aggregation.categories); - assert.equal(aggregation.categoriesCount, 8); - assert.equal(aggregation.count, 24); - assert.equal(aggregation.nulls, 0); + assert.strictEqual(aggregation.categoriesCount, 8); + assert.strictEqual(aggregation.count, 24); + assert.strictEqual(aggregation.nulls, 0); var aggregated_categories = aggregation.categories.filter(function (category) { return category.agg === true; }); - assert.equal(aggregated_categories.length, 1); - assert.equal(aggregated_categories[0].value, operations_and_values[operation]); + assert.strictEqual(aggregated_categories.length, 1); + assert.strictEqual(aggregated_categories[0].value, operations_and_values[operation]); done(); }); @@ -154,9 +154,9 @@ describe('aggregations happy cases', function () { assert.ifError(err); assert.ok(searchResult); - assert.equal(searchResult.type, 'aggregation'); + assert.strictEqual(searchResult.type, 'aggregation'); - assert.equal(searchResult.categories.length, 1); + assert.strictEqual(searchResult.categories.length, 1); assert.deepEqual( searchResult.categories, widgetSearchExpects[operation] @@ -409,7 +409,7 @@ describe('aggregation dataview tuned by categories query param', function () { it(`should handle cartegories to customize aggregations: ${JSON.stringify(scenario.params)}`, function (done) { this.testClient.getDataview('categories', scenario.params, (err, dataview) => { assert.ifError(err); - assert.equal(dataview.categories.length, scenario.categoriesExpected); + assert.strictEqual(dataview.categories.length, scenario.categoriesExpected); done(); }); }); @@ -474,7 +474,7 @@ describe('Count aggregation', function () { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview('categories', { own_filter: 0, categories: 0 }, (err, dataview) => { assert.ifError(err); - assert.equal(dataview.categories.length, 3); + assert.strictEqual(dataview.categories.length, 3); this.testClient.drain(done); }); }); @@ -484,7 +484,7 @@ describe('Count aggregation', function () { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview('categories', { own_filter: 0, categories: 0 }, (err, dataview) => { assert.ifError(err); - assert.equal(dataview.categories.length, 3); + assert.strictEqual(dataview.categories.length, 3); this.testClient.drain(done); }); }); diff --git a/test/acceptance/dataviews/histogram-test.js b/test/acceptance/dataviews/histogram-test.js index 945fc9dd..9c54cbcc 100644 --- a/test/acceptance/dataviews/histogram-test.js +++ b/test/acceptance/dataviews/histogram-test.js @@ -121,7 +121,7 @@ describe('histogram-dataview', function() { this.testClient.getDataview('pop_max_histogram', params, function(err, dataview) { assert.ok(!err, err); - assert.equal(dataview.type, 'histogram'); + assert.strictEqual(dataview.type, 'histogram'); assert.ok(dataview.bin_width > 0, 'Unexpected bin width: ' + dataview.bin_width); dataview.bins.forEach(function(bin) { assert.ok(bin.min <= bin.max, 'bin min < bin max: ' + JSON.stringify(bin)); @@ -143,7 +143,7 @@ describe('histogram-dataview', function() { this.testClient.getDataview('pop_max_histogram', params, function(err, res) { assert.ok(!err, err); assert.ok(res.errors); - assert.equal(res.errors.length, 1); + assert.strictEqual(res.errors.length, 1); assert.ok(res.errors[0].match(/Invalid number format for parameter 'bins'/)); done(); @@ -538,16 +538,16 @@ describe('histogram-dataview for date column type', function() { this.testClient.getDataview(test.dataviewId, {}, function(err, dataview) { assert.ok(!err, err); - assert.equal(dataview.type, 'histogram'); + assert.strictEqual(dataview.type, 'histogram'); assert.ok(dataview.bin_width > 0, 'Unexpected bin width: ' + dataview.bin_width); - assert.equal(dataview.bins.length, 15); + assert.strictEqual(dataview.bins.length, 15); var initialTimestamp = '2007-02-01T00:00:00-04:00'; // EDT midnight var binsStartInMilliseconds = dataview.bins_start * 1000; var binsStartFormatted = moment.utc(binsStartInMilliseconds) .utcOffset(OFFSET_EDT_IN_MINUTES) .format(); - assert.equal(binsStartFormatted, initialTimestamp); + assert.strictEqual(binsStartFormatted, initialTimestamp); dataview.bins.forEach(function(bin, index) { var binTimestampExpected = moment.utc(initialTimestamp) @@ -559,7 +559,7 @@ describe('histogram-dataview for date column type', function() { .utcOffset(OFFSET_EDT_IN_MINUTES) .format(); - assert.equal(binTimestampFormatted, binTimestampExpected); + assert.strictEqual(binTimestampFormatted, binTimestampExpected); assert.ok(bin.timestamp <= bin.min, 'bin timestamp < bin min: ' + JSON.stringify(bin)); assert.ok(bin.min <= bin.max, 'bin min < bin max: ' + JSON.stringify(bin)); }); @@ -576,9 +576,9 @@ describe('histogram-dataview for date column type', function() { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview(test.dataviewId, params, function (err, dataview) { assert.ok(!err, err); - assert.equal(dataview.type, 'histogram'); + assert.strictEqual(dataview.type, 'histogram'); assert.ok(dataview.bin_width > 0, 'Unexpected bin width: ' + dataview.bin_width); - assert.equal(dataview.bins.length, 61); + assert.strictEqual(dataview.bins.length, 61); dataview.bins.forEach(function (bin) { assert.ok(bin.min <= bin.max, 'bin min < bin max: ' + JSON.stringify(bin)); }); @@ -596,9 +596,9 @@ describe('histogram-dataview for date column type', function() { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview(test.dataviewId, params, function (err, dataview) { assert.ok(!err, err); - assert.equal(dataview.type, 'histogram'); + assert.strictEqual(dataview.type, 'histogram'); assert.ok(dataview.bin_width > 0, 'Unexpected bin width: ' + dataview.bin_width); - assert.equal(dataview.bins_count, 6); + assert.strictEqual(dataview.bins_count, 6); dataview.bins.forEach(function (bin) { assert.ok(bin.min <= bin.max, 'bin min < bin max: ' + JSON.stringify(bin)); }); @@ -616,7 +616,7 @@ describe('histogram-dataview for date column type', function() { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview(test.dataviewId, params, function (err, dataview) { assert.ok(!err, err); - assert.equal(dataview.type, 'histogram'); + assert.strictEqual(dataview.type, 'histogram'); assert.ok(dataview.bin_width > 0, 'Unexpected bin width: ' + dataview.bin_width); done(); @@ -633,16 +633,16 @@ describe('histogram-dataview for date column type', function() { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview(test.dataviewId, params, function (err, dataview) { assert.ok(!err, err); - assert.equal(dataview.type, 'histogram'); + assert.strictEqual(dataview.type, 'histogram'); assert.ok(dataview.bin_width > 0, 'Unexpected bin width: ' + dataview.bin_width); - assert.equal(dataview.bins.length, 15); + assert.strictEqual(dataview.bins.length, 15); var initialTimestamp = '2007-02-01T00:00:00+02:00'; // CEST midnight var binsStartInMilliseconds = dataview.bins_start * 1000; var binsStartFormatted = moment.utc(binsStartInMilliseconds) .utcOffset(OFFSET_CEST_IN_MINUTES) .format(); - assert.equal(binsStartFormatted, initialTimestamp); + assert.strictEqual(binsStartFormatted, initialTimestamp); dataview.bins.forEach(function (bin, index) { var binTimestampExpected = moment.utc(initialTimestamp) @@ -654,7 +654,7 @@ describe('histogram-dataview for date column type', function() { .utcOffset(OFFSET_CEST_IN_MINUTES) .format(); - assert.equal(binTimestampFormatted, binTimestampExpected); + assert.strictEqual(binTimestampFormatted, binTimestampExpected); assert.ok(bin.timestamp <= bin.min, 'bin timestamp < bin min: ' + JSON.stringify(bin)); assert.ok(bin.min <= bin.max, 'bin min < bin max: ' + JSON.stringify(bin)); }); @@ -673,16 +673,16 @@ describe('histogram-dataview for date column type', function() { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview(test.dataviewId, params, function (err, dataview) { assert.ok(!err, err); - assert.equal(dataview.type, 'histogram'); + assert.strictEqual(dataview.type, 'histogram'); assert.ok(dataview.bin_width > 0, 'Unexpected bin width: ' + dataview.bin_width); - assert.equal(dataview.bins.length, 15); + assert.strictEqual(dataview.bins.length, 15); var initialTimestamp = '2007-02-01T00:00:00Z'; // UTC midnight var binsStartInMilliseconds = dataview.bins_start * 1000; var binsStartFormatted = moment.utc(binsStartInMilliseconds) .utcOffset(OFFSET_UTC_IN_MINUTES) .format(); - assert.equal(binsStartFormatted, initialTimestamp); + assert.strictEqual(binsStartFormatted, initialTimestamp); dataview.bins.forEach(function (bin, index) { var binTimestampExpected = moment.utc(initialTimestamp) @@ -694,7 +694,7 @@ describe('histogram-dataview for date column type', function() { .utcOffset(OFFSET_UTC_IN_MINUTES) .format(); - assert.equal(binTimestampFormatted, binTimestampExpected); + assert.strictEqual(binTimestampFormatted, binTimestampExpected); assert.ok(bin.timestamp <= bin.min, 'bin timestamp < bin min: ' + JSON.stringify(bin)); assert.ok(bin.min <= bin.max, 'bin min < bin max: ' + JSON.stringify(bin)); }); @@ -714,16 +714,16 @@ describe('histogram-dataview for date column type', function() { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview('datetime_histogram_automatic_second', params, function (err, dataview) { assert.ok(!err, err); - assert.equal(dataview.type, 'histogram'); + assert.strictEqual(dataview.type, 'histogram'); assert.ok(dataview.bin_width > 0, 'Unexpected bin width: ' + dataview.bin_width); - assert.equal(dataview.bins.length, 57); + assert.strictEqual(dataview.bins.length, 57); var initialTimestamp = '2007-02-15T01:00:00Z'; var binsStartInMilliseconds = dataview.bins_start * 1000; var binsStartFormatted = moment.utc(binsStartInMilliseconds) .utcOffset(OFFSET_UTC_IN_MINUTES) .format(); - assert.equal(binsStartFormatted, initialTimestamp); + assert.strictEqual(binsStartFormatted, initialTimestamp); dataview.bins.forEach(function (bin, index) { var binTimestampExpected = moment.utc(initialTimestamp) @@ -735,7 +735,7 @@ describe('histogram-dataview for date column type', function() { .utcOffset(OFFSET_UTC_IN_MINUTES) .format(); - assert.equal(binTimestampFormatted, binTimestampExpected); + assert.strictEqual(binTimestampFormatted, binTimestampExpected); assert.ok(bin.timestamp <= bin.min, 'bin timestamp < bin min: ' + JSON.stringify(bin)); assert.ok(bin.min <= bin.max, 'bin min < bin max: ' + JSON.stringify(bin)); }); @@ -755,16 +755,16 @@ describe('histogram-dataview for date column type', function() { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview(test.dataviewId, params, function (err, dataview) { assert.ok(!err, err); - assert.equal(dataview.type, 'histogram'); + assert.strictEqual(dataview.type, 'histogram'); assert.ok(dataview.bin_width > 0, 'Unexpected bin width: ' + dataview.bin_width); - assert.equal(dataview.bins.length, 6); + assert.strictEqual(dataview.bins.length, 6); var initialTimestamp = '2007-01-01T00:00:00Z'; // UTC midnight var binsStartInMilliseconds = dataview.bins_start * 1000; var binsStartFormatted = moment.utc(binsStartInMilliseconds) .utcOffset(OFFSET_UTC_IN_MINUTES) .format(); - assert.equal(binsStartFormatted, initialTimestamp); + assert.strictEqual(binsStartFormatted, initialTimestamp); dataview.bins.forEach(function (bin, index) { var binTimestampExpected = moment.utc(initialTimestamp) @@ -776,7 +776,7 @@ describe('histogram-dataview for date column type', function() { .utcOffset(OFFSET_UTC_IN_MINUTES) .format(); - assert.equal(binTimestampFormatted, binTimestampExpected); + assert.strictEqual(binTimestampFormatted, binTimestampExpected); assert.ok(bin.timestamp <= bin.min, 'bin timestamp < bin min: ' + JSON.stringify(bin)); assert.ok(bin.min <= bin.max, 'bin min < bin max: ' + JSON.stringify(bin)); }); @@ -796,16 +796,16 @@ describe('histogram-dataview for date column type', function() { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview('datetime_histogram_automatic_decade', params, function (err, dataview) { assert.ok(!err, err); - assert.equal(dataview.type, 'histogram'); + assert.strictEqual(dataview.type, 'histogram'); assert.ok(dataview.bin_width > 0, 'Unexpected bin width: ' + dataview.bin_width); - assert.equal(dataview.bins.length, 17); + assert.strictEqual(dataview.bins.length, 17); var initialTimestamp = '1850-01-01T00:00:00Z'; var binsStartInMilliseconds = dataview.bins_start * 1000; var binsStartFormatted = moment.utc(binsStartInMilliseconds) .utcOffset(OFFSET_UTC_IN_MINUTES) .format(); - assert.equal(binsStartFormatted, initialTimestamp); + assert.strictEqual(binsStartFormatted, initialTimestamp); dataview.bins.forEach(function (bin, index) { var binTimestampExpected = moment.utc(initialTimestamp) @@ -817,7 +817,7 @@ describe('histogram-dataview for date column type', function() { .utcOffset(OFFSET_UTC_IN_MINUTES) .format(); - assert.equal(binTimestampFormatted, binTimestampExpected); + assert.strictEqual(binTimestampFormatted, binTimestampExpected); assert.ok(bin.timestamp <= bin.min, 'bin timestamp < bin min: ' + JSON.stringify(bin)); assert.ok(bin.min <= bin.max, 'bin min < bin max: ' + JSON.stringify(bin)); }); @@ -837,16 +837,16 @@ describe('histogram-dataview for date column type', function() { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview('datetime_histogram_automatic_century', params, function (err, dataview) { assert.ok(!err, err); - assert.equal(dataview.type, 'histogram'); + assert.strictEqual(dataview.type, 'histogram'); assert.ok(dataview.bin_width > 0, 'Unexpected bin width: ' + dataview.bin_width); - assert.equal(dataview.bins.length, 14); + assert.strictEqual(dataview.bins.length, 14); var initialTimestamp = '0601-01-01T00:00:00Z'; var binsStartInMilliseconds = dataview.bins_start * 1000; var binsStartFormatted = moment.utc(binsStartInMilliseconds) .utcOffset(OFFSET_UTC_IN_MINUTES) .format(); - assert.equal(binsStartFormatted, initialTimestamp); + assert.strictEqual(binsStartFormatted, initialTimestamp); dataview.bins.forEach(function (bin, index) { var binTimestampExpected = moment.utc(initialTimestamp) @@ -858,7 +858,7 @@ describe('histogram-dataview for date column type', function() { .utcOffset(OFFSET_UTC_IN_MINUTES) .format(); - assert.equal(binTimestampFormatted, binTimestampExpected); + assert.strictEqual(binTimestampFormatted, binTimestampExpected); assert.ok(bin.timestamp <= bin.min, 'bin timestamp < bin min: ' + JSON.stringify(bin)); assert.ok(bin.min <= bin.max, 'bin min < bin max: ' + JSON.stringify(bin)); }); @@ -878,16 +878,16 @@ describe('histogram-dataview for date column type', function() { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview('datetime_histogram_automatic_millennium', params, function (err, dataview) { assert.ok(!err, err); - assert.equal(dataview.type, 'histogram'); + assert.strictEqual(dataview.type, 'histogram'); assert.ok(dataview.bin_width > 0, 'Unexpected bin width: ' + dataview.bin_width); - assert.equal(dataview.bins.length, 12); + assert.strictEqual(dataview.bins.length, 12); var initialTimestamp = '0001-01-01T00:00:00Z'; var binsStartInMilliseconds = dataview.bins_start * 1000; var binsStartFormatted = moment.utc(binsStartInMilliseconds) .utcOffset(OFFSET_UTC_IN_MINUTES) .format(); - assert.equal(binsStartFormatted, initialTimestamp); + assert.strictEqual(binsStartFormatted, initialTimestamp); dataview.bins.forEach(function (bin, index) { var binTimestampExpected = moment.utc(initialTimestamp) @@ -899,7 +899,7 @@ describe('histogram-dataview for date column type', function() { .utcOffset(OFFSET_UTC_IN_MINUTES) .format(); - assert.equal(binTimestampFormatted, binTimestampExpected); + assert.strictEqual(binTimestampFormatted, binTimestampExpected); assert.ok(bin.timestamp <= bin.min, 'bin timestamp < bin min: ' + JSON.stringify(bin)); assert.ok(bin.min <= bin.max, 'bin min < bin max: ' + JSON.stringify(bin)); }); @@ -924,10 +924,10 @@ describe('histogram-dataview for date column type', function() { this.testClient.getDataview(test.dataviewId, params, function (err, dataview) { assert.ifError(err); - assert.equal(dataview.type, 'histogram'); - assert.equal(dataview.bins.length, 6); - assert.equal(dataview.bins_count, 6); - assert.equal(dataview.bins_count, dataview.bins.length); + assert.strictEqual(dataview.type, 'histogram'); + assert.strictEqual(dataview.bins.length, 6); + assert.strictEqual(dataview.bins_count, 6); + assert.strictEqual(dataview.bins_count, dataview.bins.length); done(); }); }); @@ -945,9 +945,9 @@ describe('histogram-dataview for date column type', function() { this.testClient.getDataview(test.dataviewId, params, function (err, dataview) { assert.ifError(err); - assert.equal(dataview.type, 'histogram'); - assert.equal(dataview.bins.length, 6); - assert.equal(dataview.bins_count, 7); + assert.strictEqual(dataview.type, 'histogram'); + assert.strictEqual(dataview.bins.length, 6); + assert.strictEqual(dataview.bins_count, 7); assert.ok(dataview.bins_count > dataview.bins.length); done(); }); @@ -979,8 +979,8 @@ describe('histogram-dataview for date column type', function() { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview('datetime_histogram_automatic_second', params, function (err, dataview) { assert.ifError(err); - assert.equal(dataview.type, 'histogram'); - assert.equal(dataview.aggregation, 'second'); + assert.strictEqual(dataview.type, 'histogram'); + assert.strictEqual(dataview.aggregation, 'second'); done(); }); }); @@ -990,8 +990,8 @@ describe('histogram-dataview for date column type', function() { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview('datetime_histogram_automatic_minute', params, function (err, dataview) { assert.ifError(err); - assert.equal(dataview.type, 'histogram'); - assert.equal(dataview.aggregation, 'minute'); + assert.strictEqual(dataview.type, 'histogram'); + assert.strictEqual(dataview.aggregation, 'minute'); done(); }); }); @@ -1001,8 +1001,8 @@ describe('histogram-dataview for date column type', function() { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview('datetime_histogram_automatic_hour', params, function (err, dataview) { assert.ifError(err); - assert.equal(dataview.type, 'histogram'); - assert.equal(dataview.aggregation, 'hour'); + assert.strictEqual(dataview.type, 'histogram'); + assert.strictEqual(dataview.aggregation, 'hour'); done(); }); }); @@ -1012,8 +1012,8 @@ describe('histogram-dataview for date column type', function() { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview('datetime_histogram_automatic_day', params, function (err, dataview) { assert.ifError(err); - assert.equal(dataview.type, 'histogram'); - assert.equal(dataview.aggregation, 'day'); + assert.strictEqual(dataview.type, 'histogram'); + assert.strictEqual(dataview.aggregation, 'day'); done(); }); }); @@ -1023,8 +1023,8 @@ describe('histogram-dataview for date column type', function() { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview('datetime_histogram_automatic_week', params, function (err, dataview) { assert.ifError(err); - assert.equal(dataview.type, 'histogram'); - assert.equal(dataview.aggregation, 'week'); + assert.strictEqual(dataview.type, 'histogram'); + assert.strictEqual(dataview.aggregation, 'week'); done(); }); }); @@ -1034,8 +1034,8 @@ describe('histogram-dataview for date column type', function() { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview('datetime_histogram_automatic_month', params, function (err, dataview) { assert.ifError(err); - assert.equal(dataview.type, 'histogram'); - assert.equal(dataview.aggregation, 'month'); + assert.strictEqual(dataview.type, 'histogram'); + assert.strictEqual(dataview.aggregation, 'month'); done(); }); }); @@ -1045,8 +1045,8 @@ describe('histogram-dataview for date column type', function() { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview('datetime_histogram_automatic_quarter', params, function (err, dataview) { assert.ifError(err); - assert.equal(dataview.type, 'histogram'); - assert.equal(dataview.aggregation, 'quarter'); + assert.strictEqual(dataview.type, 'histogram'); + assert.strictEqual(dataview.aggregation, 'quarter'); done(); }); }); @@ -1056,8 +1056,8 @@ describe('histogram-dataview for date column type', function() { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview('datetime_histogram_automatic_year', params, function (err, dataview) { assert.ifError(err); - assert.equal(dataview.type, 'histogram'); - assert.equal(dataview.aggregation, 'year'); + assert.strictEqual(dataview.type, 'histogram'); + assert.strictEqual(dataview.aggregation, 'year'); done(); }); }); @@ -1067,8 +1067,8 @@ describe('histogram-dataview for date column type', function() { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview('datetime_histogram_automatic_decade', params, function (err, dataview) { assert.ifError(err); - assert.equal(dataview.type, 'histogram'); - assert.equal(dataview.aggregation, 'decade'); + assert.strictEqual(dataview.type, 'histogram'); + assert.strictEqual(dataview.aggregation, 'decade'); done(); }); }); @@ -1078,8 +1078,8 @@ describe('histogram-dataview for date column type', function() { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview('datetime_histogram_automatic_century', params, function (err, dataview) { assert.ifError(err); - assert.equal(dataview.type, 'histogram'); - assert.equal(dataview.aggregation, 'century'); + assert.strictEqual(dataview.type, 'histogram'); + assert.strictEqual(dataview.aggregation, 'century'); done(); }); }); @@ -1089,8 +1089,8 @@ describe('histogram-dataview for date column type', function() { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview('datetime_histogram_automatic_millennium', params, function (err, dataview) { assert.ifError(err); - assert.equal(dataview.type, 'histogram'); - assert.equal(dataview.aggregation, 'millennium'); + assert.strictEqual(dataview.type, 'histogram'); + assert.strictEqual(dataview.aggregation, 'millennium'); done(); }); }); @@ -1102,10 +1102,10 @@ describe('histogram-dataview for date column type', function() { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getDataview('date_histogram', params, function (err, dataview) { assert.ifError(err); - assert.equal(dataview.type, 'histogram'); - assert.equal(dataview.aggregation, 'year'); - assert.equal(dataview.bins.length, 2); - assert.equal(dataview.bins_count, 2); + assert.strictEqual(dataview.type, 'histogram'); + assert.strictEqual(dataview.aggregation, 'year'); + assert.strictEqual(dataview.bins.length, 2); + assert.strictEqual(dataview.bins_count, 2); done(); }); }); @@ -1507,8 +1507,8 @@ describe('histogram-dates: timestamp starts at epoch', function() { const { aggregation, timestamp_start } = dataview; - assert.equal(timestamp_start, 0); - assert.equal(aggregation, 'quarter'); + assert.strictEqual(timestamp_start, 0); + assert.strictEqual(aggregation, 'quarter'); done(); }); @@ -1618,7 +1618,7 @@ describe('histogram-dates: trunc timestamp for each bin respecting user\'s timez var binsStartFormatted = moment.utc(binsStartInMilliseconds) .utcOffset(OFFSET_IN_MINUTES) .format(); - assert.equal(binsStartFormatted, initialTimestamp); + assert.strictEqual(binsStartFormatted, initialTimestamp); dataview.bins.forEach(function (bin, index) { var binTimestampExpected = moment.utc(initialTimestamp) @@ -1630,7 +1630,7 @@ describe('histogram-dates: trunc timestamp for each bin respecting user\'s timez .utcOffset(OFFSET_IN_MINUTES) .format(); - assert.equal(binTimestampFormatted, binTimestampExpected); + assert.strictEqual(binTimestampFormatted, binTimestampExpected); assert.ok(bin.timestamp <= bin.min, 'bin timestamp < bin min: ' + JSON.stringify(bin)); assert.ok(bin.min <= bin.max, 'bin min < bin max: ' + JSON.stringify(bin)); }); @@ -1711,7 +1711,7 @@ describe('histogram: be able to override with aggregation for histograms instant var binsStartFormatted = moment.utc(binsStartInMilliseconds) .utcOffset(OFFSET_IN_MINUTES) .format(); - assert.equal(binsStartFormatted, initialTimestamp); + assert.strictEqual(binsStartFormatted, initialTimestamp); dataview.bins.forEach(function (bin, index) { var binTimestampExpected = moment.utc(initialTimestamp) @@ -1723,7 +1723,7 @@ describe('histogram: be able to override with aggregation for histograms instant .utcOffset(OFFSET_IN_MINUTES) .format(); - assert.equal(binTimestampFormatted, binTimestampExpected); + assert.strictEqual(binTimestampFormatted, binTimestampExpected); assert.ok(bin.timestamp <= bin.min, 'bin timestamp < bin min: ' + JSON.stringify(bin)); assert.ok(bin.min <= bin.max, 'bin min < bin max: ' + JSON.stringify(bin)); }); diff --git a/test/acceptance/dataviews/overviews-test.js b/test/acceptance/dataviews/overviews-test.js index 989700c6..ae4f41e7 100644 --- a/test/acceptance/dataviews/overviews-test.js +++ b/test/acceptance/dataviews/overviews-test.js @@ -385,7 +385,7 @@ describe('dataviews using tables with overviews', function () { return done(err); } assert.ok(histogram); - assert.equal(histogram.type, 'histogram'); + assert.strictEqual(histogram.type, 'histogram'); assert.ok(Array.isArray(histogram.bins)); assert.ok(getUsesOverviewsFromHeaders(headers)); // Overviews logging assert(getDataviewTypeFromHeaders(headers) === 'histogram'); // Overviews logging @@ -409,9 +409,9 @@ describe('dataviews using tables with overviews', function () { return done(err); } assert.ok(histogram); - assert.equal(histogram.type, 'histogram'); + assert.strictEqual(histogram.type, 'histogram'); assert.ok(Array.isArray(histogram.bins)); - assert.equal(histogram.bins.length, 4); + assert.strictEqual(histogram.bins.length, 4); testClient.drain(done); }); }); @@ -429,9 +429,9 @@ describe('dataviews using tables with overviews', function () { return done(err); } assert.ok(histogram); - assert.equal(histogram.type, 'histogram'); + assert.strictEqual(histogram.type, 'histogram'); assert.ok(Array.isArray(histogram.bins)); - assert.equal(histogram.bins.length, 0); + assert.strictEqual(histogram.bins.length, 0); testClient.drain(done); }); }); @@ -451,9 +451,9 @@ describe('dataviews using tables with overviews', function () { return done(err); } assert.ok(histogram); - assert.equal(histogram.type, 'histogram'); + assert.strictEqual(histogram.type, 'histogram'); assert.ok(Array.isArray(histogram.bins)); - assert.equal(histogram.bins.length, 0); + assert.strictEqual(histogram.bins.length, 0); testClient.drain(done); }); }); diff --git a/test/acceptance/dynamic-styling-named-maps-test.js b/test/acceptance/dynamic-styling-named-maps-test.js index 1d2ed2e0..1415c409 100644 --- a/test/acceptance/dynamic-styling-named-maps-test.js +++ b/test/acceptance/dynamic-styling-named-maps-test.js @@ -104,7 +104,7 @@ describe('dynamic styling for named maps', function () { }, function checkTemplate (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200); + assert.strictEqual(res.statusCode, 200); assert.deepEqual(JSON.parse(res.body), { template_id: templateId }); @@ -131,19 +131,19 @@ describe('dynamic styling for named maps', function () { function checkInstanciation (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200); + assert.strictEqual(res.statusCode, 200); var parsedBody = JSON.parse(res.body); keysToDelete['map_cfg|' + LayergroupToken.parse(parsedBody.layergroupid).token] = 0; keysToDelete['user:localhost:mapviews:global'] = 5; - assert.equal(parsedBody.metadata.layers[0].meta.cartocss, templateParams.styles['0']); - assert.equal( + assert.strictEqual(parsedBody.metadata.layers[0].meta.cartocss, templateParams.styles['0']); + assert.strictEqual( parsedBody.metadata.layers[1].meta.cartocss, template.layergroup.layers[1].options.cartocss ); - assert.equal(parsedBody.metadata.layers[2].meta.cartocss, templateParams.styles['2']); + assert.strictEqual(parsedBody.metadata.layers[2].meta.cartocss, templateParams.styles['2']); return parsedBody.layergroupid; }, @@ -162,7 +162,7 @@ describe('dynamic styling for named maps', function () { }, function checkDeleteTemplate (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 204); + assert.strictEqual(res.statusCode, 204); assert.ok(!res.body); return null; diff --git a/test/acceptance/errors-with-context-test.js b/test/acceptance/errors-with-context-test.js index 229f2f0d..7098fb10 100644 --- a/test/acceptance/errors-with-context-test.js +++ b/test/acceptance/errors-with-context-test.js @@ -64,8 +64,8 @@ describe('error with context', function () { assert.ok(Array.isArray(parsedBody.errors_with_context)); var err = parsedBody.errors_with_context[0]; - assert.equal(err.type, 'layer'); - assert.equal(err.subtype, 'query'); + assert.strictEqual(err.type, 'layer'); + assert.strictEqual(err.subtype, 'query'); assert.ok(err.message.indexOf(DB_ERROR_MESSAGE) >= 0); assert.deepEqual(err.layer, scenario.expectedFailingLayer); done(); diff --git a/test/acceptance/health-check-test.js b/test/acceptance/health-check-test.js index 4f9921d3..53ac76f7 100644 --- a/test/acceptance/health-check-test.js +++ b/test/acceptance/health-check-test.js @@ -71,7 +71,7 @@ describe('health checks', function () { var parsed = JSON.parse(res.body); assert.ok(parsed.enabled); assert.ok(!parsed.ok); - assert.equal(parsed.err, errorMessage); + assert.strictEqual(parsed.err, errorMessage); done(); }); @@ -91,7 +91,7 @@ describe('health checks', function () { var parsed = JSON.parse(res.body); assert.ok(parsed.enabled); assert.ok(!parsed.ok); - assert.equal(parsed.err, 'Unknown error'); + assert.strictEqual(parsed.err, 'Unknown error'); done(); }); @@ -107,8 +107,8 @@ describe('health checks', function () { var parsed = JSON.parse(res.body); - assert.equal(parsed.enabled, true); - assert.equal(parsed.ok, true); + assert.strictEqual(parsed.enabled, true); + assert.strictEqual(parsed.ok, true); done(); }); diff --git a/test/acceptance/layergroup-metadata-test.js b/test/acceptance/layergroup-metadata-test.js index d615bac2..98661f76 100644 --- a/test/acceptance/layergroup-metadata-test.js +++ b/test/acceptance/layergroup-metadata-test.js @@ -48,9 +48,9 @@ describe('layergroup metadata', function () { } assert.ok(body.layergroupid); - assert.equal(body.metadata.layers[0].tilejson.vector.tiles[0], urlLayer); - assert.equal(body.metadata.tilejson.vector.tiles[0], urlNoLayer); - assert.equal(body.metadata.url.vector.urlTemplate, urlNoLayer); + assert.strictEqual(body.metadata.layers[0].tilejson.vector.tiles[0], urlLayer); + assert.strictEqual(body.metadata.tilejson.vector.tiles[0], urlNoLayer); + assert.strictEqual(body.metadata.url.vector.urlTemplate, urlNoLayer); testClient.drain(done); }); diff --git a/test/acceptance/multilayer-server-test.js b/test/acceptance/multilayer-server-test.js index 86677ea5..12b6ca34 100644 --- a/test/acceptance/multilayer-server-test.js +++ b/test/acceptance/multilayer-server-test.js @@ -93,7 +93,7 @@ describe('tests from old api translated to multilayer', function () { }, function (res) { var parsed = JSON.parse(res.body); - assert.equal(parsed.errors.length, 1); + assert.strictEqual(parsed.errors.length, 1); assert.ok(parsed.errors[0].match(/^style0/)); assert.ok(parsed.errors[0].match(/Unrecognized rule: backgxxxxxround-color/)); assert.ok(parsed.errors[0].match(/Unrecognized rule: foo/)); @@ -114,7 +114,7 @@ describe('tests from old api translated to multilayer', function () { function (res) { var parsed = JSON.parse(res.body); assert.ok(parsed.layergroupid); - assert.equal(res.headers['x-layergroup-id'], parsed.layergroupid); + assert.strictEqual(res.headers['x-layergroup-id'], parsed.layergroupid); keysToDelete['map_cfg|' + LayergroupToken.parse(parsed.layergroupid).token] = 0; keysToDelete['user:localhost:mapviews:global'] = 5; @@ -139,7 +139,7 @@ describe('tests from old api translated to multilayer', function () { function (res) { var parsed = JSON.parse(res.body); assert.ok(parsed.layergroupid); - assert.equal(res.headers['x-layergroup-id'], parsed.layergroupid); + assert.strictEqual(res.headers['x-layergroup-id'], parsed.layergroupid); keysToDelete['map_cfg|' + LayergroupToken.parse(parsed.layergroupid).token] = 0; keysToDelete['user:cartodb250user:mapviews:global'] = 5; @@ -165,7 +165,7 @@ describe('tests from old api translated to multilayer', function () { function (res) { var parsed = JSON.parse(res.body); assert.ok(parsed.layergroupid); - assert.equal(res.headers['x-layergroup-id'], parsed.layergroupid); + assert.strictEqual(res.headers['x-layergroup-id'], parsed.layergroupid); keysToDelete['map_cfg|' + LayergroupToken.parse(parsed.layergroupid).token] = 0; keysToDelete['user:cartodb250user:mapviews:global'] = 5; @@ -234,7 +234,7 @@ describe('tests from old api translated to multilayer', function () { function (res) { var parsed = JSON.parse(res.body); assert.ok(parsed.errors); - assert.equal(parsed.errors.length, 1); + assert.strictEqual(parsed.errors.length, 1); assert.ok(parsed.errors[0].match(/Unexpected token W/)); done(); @@ -268,9 +268,9 @@ describe('tests from old api translated to multilayer', function () { assert.ok(parsed.layergroupid); assert.ok(res.headers.hasOwnProperty('x-cache-channel')); - assert.equal(res.headers['x-cache-channel'], expectedCacheChannel); + assert.strictEqual(res.headers['x-cache-channel'], expectedCacheChannel); - assert.equal(res.headers['x-layergroup-id'], parsed.layergroupid); + assert.strictEqual(res.headers['x-layergroup-id'], parsed.layergroupid); keysToDelete['map_cfg|' + LayergroupToken.parse(parsed.layergroupid).token] = 0; keysToDelete['user:localhost:mapviews:global'] = 5; @@ -306,9 +306,9 @@ describe('tests from old api translated to multilayer', function () { assert.ok(parsed.layergroupid); assert.ok(res.headers.hasOwnProperty('x-cache-channel')); - assert.equal(res.headers['x-cache-channel'], expectedCacheChannel); + assert.strictEqual(res.headers['x-cache-channel'], expectedCacheChannel); - assert.equal(res.headers['x-layergroup-id'], parsed.layergroupid); + assert.strictEqual(res.headers['x-layergroup-id'], parsed.layergroupid); done(); } diff --git a/test/acceptance/multilayer-test.js b/test/acceptance/multilayer-test.js index 3d054bd3..3222d524 100644 --- a/test/acceptance/multilayer-test.js +++ b/test/acceptance/multilayer-test.js @@ -86,10 +86,10 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(layergroup) }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsedBody = JSON.parse(res.body); - assert.equal(parsedBody.last_updated, expected_last_updated); - assert.equal(res.headers['x-layergroup-id'], parsedBody.layergroupid); + assert.strictEqual(parsedBody.last_updated, expected_last_updated); + assert.strictEqual(res.headers['x-layergroup-id'], parsedBody.layergroupid); expected_token = parsedBody.layergroupid; next(null, res); }); @@ -103,18 +103,18 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost' }, encoding: 'binary' }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'image/png'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'image/png'); // Check Cache-Control var cc = res.headers['cache-control']; - assert.equal(cc, 'public,max-age=31536000'); // 1 year + assert.strictEqual(cc, 'public,max-age=31536000'); // 1 year // Check X-Cache-Channel cc = res.headers['x-cache-channel']; assert.ok(cc); var dbname = test_database; - assert.equal(cc.substring(0, dbname.length), dbname); + assert.strictEqual(cc.substring(0, dbname.length), dbname); if (!cdbQueryTablesFromPostgresEnabledValue) { // only test if it was using the SQL API var jsonquery = cc.substring(dbname.length + 1); var sentquery = JSON.parse(jsonquery); @@ -122,7 +122,7 @@ var QueryTables = require('cartodb-query-tables').queryTables; layergroup.layers[0].options.sql, ';', layergroup.layers[1].options.sql ].join(''); - assert.equal(sentquery.q, 'WITH querytables AS ( SELECT * FROM CDB_QueryTables($windshaft$' + + assert.strictEqual(sentquery.q, 'WITH querytables AS ( SELECT * FROM CDB_QueryTables($windshaft$' + expectedQuery + '$windshaft$) as tablenames )' + ' SELECT (SELECT tablenames FROM querytables), EXTRACT(EPOCH FROM max(updated_at)) as max' + @@ -147,7 +147,7 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost' }, encoding: 'binary' }, {}, function (res) { - assert.equal(res.statusCode, 403, res.statusCode + ':' + res.body); + assert.strictEqual(res.statusCode, 403, res.statusCode + ':' + res.body); var parsed = JSON.parse(res.body); var msg = parsed.errors[0]; assert.ok(msg.match(/permission denied/i), msg); @@ -162,8 +162,8 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost' }, method: 'GET' }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); assert.utfgridEqualsFile(res.body, 'test/fixtures/test_table_0_0_0_multilayer1.layer0.grid.json', 2, function (err/*, similarity */) { next(err); @@ -178,8 +178,8 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost' }, method: 'GET' }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); assert.utfgridEqualsFile(res.body, 'test/fixtures/test_table_0_0_0_multilayer1.layer1.grid.json', 2, function (err/*, similarity */) { next(err); @@ -275,7 +275,7 @@ var QueryTables = require('cartodb-query-tables').queryTables; }, function do_check_create (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsedBody = JSON.parse(res.body); expected_token = parsedBody.layergroupid.split(':')[0]; helper.checkCache(res); @@ -367,11 +367,11 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(layergroup) }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsedBody = JSON.parse(res.body); - assert.equal(parsedBody.last_updated, expected_last_updated); + assert.strictEqual(parsedBody.last_updated, expected_last_updated); if (expected_token) { - assert.equal(parsedBody.layergroupid, expected_token + ':' + expected_last_updated_epoch); + assert.strictEqual(parsedBody.layergroupid, expected_token + ':' + expected_last_updated_epoch); } else { expected_token = parsedBody.layergroupid.split(':')[0]; } @@ -387,14 +387,14 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost' }, encoding: 'binary' }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'image/png'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'image/png'); // Check X-Cache-Channel var cc = res.headers['x-cache-channel']; assert.ok(cc); var dbname = test_database; - assert.equal(cc.substring(0, dbname.length), dbname); + assert.strictEqual(cc.substring(0, dbname.length), dbname); if (!cdbQueryTablesFromPostgresEnabledValue) { // only test if it was using the SQL API var jsonquery = cc.substring(dbname.length + 1); var sentquery = JSON.parse(jsonquery); @@ -402,7 +402,7 @@ var QueryTables = require('cartodb-query-tables').queryTables; .replace(/!bbox!/g, 'ST_MakeEnvelope(0,0,0,0)') .replace(/!pixel_width!/g, '1') .replace(/!pixel_height!/g, '1'); - assert.equal(sentquery.q, 'WITH querytables AS ( SELECT * FROM CDB_QueryTables($windshaft$' + + assert.strictEqual(sentquery.q, 'WITH querytables AS ( SELECT * FROM CDB_QueryTables($windshaft$' + expectedQuery + '$windshaft$) as tablenames )' + ' SELECT (SELECT tablenames FROM querytables), EXTRACT(EPOCH FROM max(updated_at)) as max' + @@ -426,14 +426,14 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost' }, encoding: 'binary' }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'image/png'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'image/png'); // Check X-Cache-Channel var cc = res.headers['x-cache-channel']; assert.ok(cc); var dbname = test_database; - assert.equal(cc.substring(0, dbname.length), dbname); + assert.strictEqual(cc.substring(0, dbname.length), dbname); if (!cdbQueryTablesFromPostgresEnabledValue) { // only test if it was using the SQL API var jsonquery = cc.substring(dbname.length + 1); var sentquery = JSON.parse(jsonquery); @@ -441,7 +441,7 @@ var QueryTables = require('cartodb-query-tables').queryTables; .replace('!bbox!', 'ST_MakeEnvelope(0,0,0,0)') .replace('!pixel_width!', '1') .replace('!pixel_height!', '1'); - assert.equal(sentquery.q, 'WITH querytables AS ( SELECT * FROM CDB_QueryTables($windshaft$' + + assert.strictEqual(sentquery.q, 'WITH querytables AS ( SELECT * FROM CDB_QueryTables($windshaft$' + expectedQuery + '$windshaft$) as tablenames )' + ' SELECT (SELECT tablenames FROM querytables), EXTRACT(EPOCH FROM max(updated_at)) as max' + @@ -464,8 +464,8 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost' }, method: 'GET' }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); assert.utfgridEqualsFile(res.body, 'test/fixtures/test_multilayer_bbox.grid.json', 2, function (err/*, similarity */) { next(err); @@ -480,8 +480,8 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost' }, method: 'GET' }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); assert.utfgridEqualsFile(res.body, 'test/fixtures/test_multilayer_bbox.grid.json', 2, next); }); }, @@ -533,19 +533,19 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(layergroup) }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); expected_token = JSON.parse(res.body).layergroupid; redis_stats_client.zscore(statskey + ':global', now, next); }); }, function check_global_stats_1 (err, val) { assert.ifError(err); - assert.equal(val, 1, 'Expected score of ' + now + ' in ' + statskey + ':global to be 1, got ' + val); + assert.strictEqual(val, '1', 'Expected score of ' + now + ' in ' + statskey + ':global to be 1, got ' + val); redis_stats_client.zscore(statskey + ':stat_tag:random_tag', now, this); }, function check_tag_stats_1_do_post_2 (err, val) { assert.ifError(err); - assert.equal(val, 1, 'Expected score of ' + now + ' in ' + statskey + ':stat_tag:' + layergroup.stat_tag + + assert.strictEqual(val, '1', 'Expected score of ' + now + ' in ' + statskey + ':stat_tag:' + layergroup.stat_tag + ' to be 1, got ' + val); var next = this; assert.response(server, { @@ -554,19 +554,19 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(layergroup) }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(JSON.parse(res.body).layergroupid, expected_token); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(JSON.parse(res.body).layergroupid, expected_token); redis_stats_client.zscore(statskey + ':global', now, next); }); }, function check_global_stats_2 (err, val) { assert.ifError(err); - assert.equal(val, 2, 'Expected score of ' + now + ' in ' + statskey + ':global to be 2, got ' + val); + assert.strictEqual(val, '2', 'Expected score of ' + now + ' in ' + statskey + ':global to be 2, got ' + val); redis_stats_client.zscore(statskey + ':stat_tag:' + layergroup.stat_tag, now, this); }, function check_tag_stats_2 (err, val) { assert.ifError(err); - assert.equal(val, 2, 'Expected score of ' + now + ' in ' + statskey + ':stat_tag:' + layergroup.stat_tag + + assert.strictEqual(val, '2', 'Expected score of ' + now + ' in ' + statskey + ':stat_tag:' + layergroup.stat_tag + ' to be 2, got ' + val); return 1; }, @@ -605,7 +605,7 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(layergroup) }, {}, function (res) { - assert.equal(res.statusCode, 400, res.body); + assert.strictEqual(res.statusCode, 400, res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.errors[0].match(/^style0/)); assert.ok(parsed.errors[0].match(/Unrecognized rule: polygon-fit/)); @@ -635,7 +635,7 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(layergroup) }, {}, function (res) { - assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 400, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); var msg = parsed.errors[0]; assert.ok(msg.match(/bogus.*exist/), msg); @@ -677,11 +677,11 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(layergroup) }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsedBody = JSON.parse(res.body); - assert.equal(parsedBody.last_updated, expected_last_updated); + assert.strictEqual(parsedBody.last_updated, expected_last_updated); if (expected_token) { - assert.equal(parsedBody.layergroupid, expected_token + ':' + expected_last_updated_epoch); + assert.strictEqual(parsedBody.layergroupid, expected_token + ':' + expected_last_updated_epoch); } else { expected_token = parsedBody.layergroupid.split(':')[0]; } @@ -697,14 +697,14 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost' }, encoding: 'binary' }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'image/png'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'image/png'); // Check X-Cache-Channel var cc = res.headers['x-cache-channel']; assert.ok(cc); var dbname = test_database; - assert.equal(cc.substring(0, dbname.length), dbname); + assert.strictEqual(cc.substring(0, dbname.length), dbname); next(err); }); }, @@ -716,7 +716,7 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost' }, method: 'GET' }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); next(err); }); }, @@ -728,8 +728,8 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost' }, method: 'GET' }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); next(err); }); }, @@ -742,7 +742,7 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost' }, encoding: 'binary' }, {}, function (res) { - assert.equal(res.statusCode, 403); + assert.strictEqual(res.statusCode, 403); var re = new RegExp('permission denied'); assert.ok(res.body.match(re), 'No "permission denied" error: ' + res.body); next(err); @@ -756,7 +756,7 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost' }, method: 'GET' }, {}, function (res) { - assert.equal(res.statusCode, 403); + assert.strictEqual(res.statusCode, 403); var re = new RegExp('permission denied'); assert.ok(res.body.match(re), 'No "permission denied" error: ' + res.body); next(err); @@ -770,7 +770,7 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost' }, method: 'GET' }, {}, function (res) { - assert.equal(res.statusCode, 403); + assert.strictEqual(res.statusCode, 403); var re = new RegExp('permission denied'); assert.ok(res.body.match(re), 'No "permission denied" error: ' + res.body); next(err); @@ -814,11 +814,11 @@ var QueryTables = require('cartodb-query-tables').queryTables; }, function check_post (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsedBody = JSON.parse(res.body); - assert.equal(parsedBody.last_updated, expected_last_updated); + assert.strictEqual(parsedBody.last_updated, expected_last_updated); if (expected_token) { - assert.equal(parsedBody.layergroupid, expected_token + ':' + expected_last_updated_epoch); + assert.strictEqual(parsedBody.layergroupid, expected_token + ':' + expected_last_updated_epoch); } else { expected_token = parsedBody.layergroupid.split(':')[0]; } @@ -836,14 +836,14 @@ var QueryTables = require('cartodb-query-tables').queryTables; }, function do_check0 (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'image/png'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'image/png'); // Check X-Cache-Channel var cc = res.headers['x-cache-channel']; assert.ok(cc, 'Missing X-Cache-Channel'); var dbname = test_database; - assert.equal(cc.substring(0, dbname.length), dbname); + assert.strictEqual(cc.substring(0, dbname.length), dbname); return null; }, function do_restart_server (err/*, res */) { @@ -864,14 +864,14 @@ var QueryTables = require('cartodb-query-tables').queryTables; }, function do_check1 (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'image/png'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'image/png'); // Check X-Cache-Channel var cc = res.headers['x-cache-channel']; assert.ok(cc, 'Missing X-Cache-Channel on restart'); var dbname = test_database; - assert.equal(cc.substring(0, dbname.length), dbname); + assert.strictEqual(cc.substring(0, dbname.length), dbname); return null; }, function finish (err) { @@ -904,9 +904,9 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(layergroup) }, {}, function (res) { - assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 400, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); - assert.equal(parsed.errors.length, 1); + assert.strictEqual(parsed.errors.length, 1); var errmsg = parsed.errors[0]; assert.ok(errmsg.match(/text-face-name.*Dejagnu/), parsed.errors.toString()); done(); @@ -940,7 +940,7 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(layergroup) }, {}, function (res) { - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); keysToDelete['map_cfg|' + LayergroupToken.parse(JSON.parse(res.body).layergroupid).token] = 0; keysToDelete['user:localhost:mapviews:global'] = 5; done(); @@ -967,7 +967,7 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(layergroup) }, {}, function (res) { - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); keysToDelete['map_cfg|' + LayergroupToken.parse(JSON.parse(res.body).layergroupid).token] = 0; keysToDelete['user:localhost:mapviews:global'] = 5; done(); @@ -999,11 +999,11 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(layergroup) }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsedBody = JSON.parse(res.body); if (expected_token) { - assert.equal(parsedBody.layergroupid, expected_token + ':' + expected_last_updated_epoch); - assert.equal(res.headers['x-layergroup-id'], parsedBody.layergroupid); + assert.strictEqual(parsedBody.layergroupid, expected_token + ':' + expected_last_updated_epoch); + assert.strictEqual(res.headers['x-layergroup-id'], parsedBody.layergroupid); } else { var token_components = parsedBody.layergroupid.split(':'); expected_token = token_components[0]; @@ -1021,8 +1021,8 @@ var QueryTables = require('cartodb-query-tables').queryTables; headers: { host: 'localhost' }, encoding: 'binary' }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'image/png'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'image/png'); assert.imageBufferIsSimilarToFile(res.body, windshaft_fixtures + '/test_default_mapnik_point.png', IMAGE_EQUALS_TOLERANCE_PER_MIL, function (err/*, similarity */) { next(err); @@ -1069,11 +1069,11 @@ var QueryTables = require('cartodb-query-tables').queryTables; function check_result (err, res) { assert.ifError(err); var next = this; - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); var parsedBody = JSON.parse(res.body); if (expected_token) { - assert.equal(parsedBody.layergroupid, expected_token + ':' + expected_last_updated_epoch); - assert.equal(res.headers['x-layergroup-id'], parsedBody.layergroupid); + assert.strictEqual(parsedBody.layergroupid, expected_token + ':' + expected_last_updated_epoch); + assert.strictEqual(res.headers['x-layergroup-id'], parsedBody.layergroupid); } else { var token_components = parsedBody.layergroupid.split(':'); expected_token = token_components[0]; @@ -1095,7 +1095,7 @@ var QueryTables = require('cartodb-query-tables').queryTables; if (err) { return done(err); } - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); keysToDelete['user:localhost:mapviews:global'] = 5; keysToDelete['map_cfg|' + expected_token] = 0; done(err); @@ -1143,7 +1143,7 @@ var QueryTables = require('cartodb-query-tables').queryTables; }, function check_result (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); var parsedBody = JSON.parse(res.body); var token_components = parsedBody.layergroupid.split(':'); expected_token = token_components[0]; @@ -1192,12 +1192,12 @@ var QueryTables = require('cartodb-query-tables').queryTables; }, function check_post (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 400, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.errors, 'Missing "errors" in response: ' + JSON.stringify(parsed)); - assert.equal(parsed.errors.length, 1); + assert.strictEqual(parsed.errors.length, 1); var msg = parsed.errors[0]; - assert.equal(msg, 'Missing cartocss for layer 0 options'); + assert.strictEqual(msg, 'Missing cartocss for layer 0 options'); return null; }, function finish (err) { @@ -1234,10 +1234,10 @@ var QueryTables = require('cartodb-query-tables').queryTables; }, function check_post (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 400, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.errors, 'Missing "errors" in response: ' + JSON.stringify(parsed)); - assert.equal(parsed.errors.length, 1); + assert.strictEqual(parsed.errors.length, 1); var msg = parsed.errors[0]; assert.ok(msg, /could not fetch source tables/, msg); return null; @@ -1276,7 +1276,7 @@ var QueryTables = require('cartodb-query-tables').queryTables; assert.response(server, layergroupTtlRequest, layergroupTtlResponseExpectation, function (res) { - assert.equal(res.headers['cache-control'], 'public,max-age=86400,must-revalidate'); + assert.strictEqual(res.headers['cache-control'], 'public,max-age=86400,must-revalidate'); keysToDelete['map_cfg|' + LayergroupToken.parse(JSON.parse(res.body).layergroupid).token] = 0; keysToDelete['user:localhost:mapviews:global'] = 5; @@ -1293,7 +1293,7 @@ var QueryTables = require('cartodb-query-tables').queryTables; assert.response(server, layergroupTtlRequest, layergroupTtlResponseExpectation, function (res) { - assert.equal(res.headers['cache-control'], 'public,max-age=' + layergroupTtl + ',must-revalidate'); + assert.strictEqual(res.headers['cache-control'], 'public,max-age=' + layergroupTtl + ',must-revalidate'); keysToDelete['map_cfg|' + LayergroupToken.parse(JSON.parse(res.body).layergroupid).token] = 0; keysToDelete['user:localhost:mapviews:global'] = 5; diff --git a/test/acceptance/mvt-regressions-test.js b/test/acceptance/mvt-regressions-test.js index 1d39fdea..fc471061 100644 --- a/test/acceptance/mvt-regressions-test.js +++ b/test/acceptance/mvt-regressions-test.js @@ -65,7 +65,7 @@ describe('mvt regressions', function () { return done(err); } - assert.equal(typeof body.metadata, 'object'); + assert.strictEqual(typeof body.metadata, 'object'); assert.ok(Array.isArray(body.metadata.layers)); body.metadata.layers.forEach(layer => assert.ok(layer.meta.aggregation.mvt)); diff --git a/test/acceptance/mvt-test.js b/test/acceptance/mvt-test.js index 6ea5536e..73b4c381 100644 --- a/test/acceptance/mvt-test.js +++ b/test/acceptance/mvt-test.js @@ -70,7 +70,7 @@ function mvt (usePostGIS) { const tileJSON = tile.toJSON(); - assert.equal(tileJSON[0].features.length, 10); + assert.strictEqual(tileJSON[0].features.length, 10); testClient.drain(done); }); @@ -232,10 +232,10 @@ function mvt (usePostGIS) { const feature = geojsonTile.features[0]; assert.ok(feature.properties.hasOwnProperty('_feature_count'), 'Missing _feature_count property'); - assert.equal(feature.properties.cartodb_id, 1); - assert.equal(feature.properties.name, 'Hawai'); - assert.equal(feature.properties._feature_count, 5); // original table has _feature_count = 1 - assert.equal(feature.properties.value, 3); // original table has value = 1.0 + assert.strictEqual(feature.properties.cartodb_id, 1); + assert.strictEqual(feature.properties.name, 'Hawai'); + assert.strictEqual(feature.properties._feature_count, 5); // original table has _feature_count = 1 + assert.strictEqual(feature.properties.value, 3); // original table has value = 1.0 testClient.drain(done); }); @@ -274,12 +274,12 @@ function mvt (usePostGIS) { const tileWithoutOverviews = JSON.parse(mvt.toGeoJSONSync(1)); assert.ok(Array.isArray(tileWithOverviews.features)); - assert.equal(tileWithOverviews.features.length, 1); - assert.equal(tileWithOverviews.features[0].properties._feature_count, 5); + assert.strictEqual(tileWithOverviews.features.length, 1); + assert.strictEqual(tileWithOverviews.features[0].properties._feature_count, 5); assert.ok(Array.isArray(tileWithoutOverviews.features)); - assert.equal(tileWithoutOverviews.features.length, 5); - assert.equal(tileWithoutOverviews.features[0].properties._feature_count, undefined); + assert.strictEqual(tileWithoutOverviews.features.length, 5); + assert.strictEqual(tileWithoutOverviews.features[0].properties._feature_count, undefined); testClient.drain(done); }); diff --git a/test/acceptance/named-layers-test.js b/test/acceptance/named-layers-test.js index e18884ce..f5d11578 100644 --- a/test/acceptance/named-layers-test.js +++ b/test/acceptance/named-layers-test.js @@ -728,12 +728,12 @@ describe('named_layers', function () { var parsedBody = JSON.parse(response.body); assert.ok(parsedBody.metadata); assert.ok(parsedBody.metadata.layers); - assert.equal(parsedBody.metadata.layers.length, 5); - assert.equal(parsedBody.metadata.layers[0].type, 'plain'); - assert.equal(parsedBody.metadata.layers[1].type, 'mapnik'); - assert.equal(parsedBody.metadata.layers[2].type, 'mapnik'); - assert.equal(parsedBody.metadata.layers[3].type, 'mapnik'); - assert.equal(parsedBody.metadata.layers[4].type, 'torque'); + assert.strictEqual(parsedBody.metadata.layers.length, 5); + assert.strictEqual(parsedBody.metadata.layers[0].type, 'plain'); + assert.strictEqual(parsedBody.metadata.layers[1].type, 'mapnik'); + assert.strictEqual(parsedBody.metadata.layers[2].type, 'mapnik'); + assert.strictEqual(parsedBody.metadata.layers[3].type, 'mapnik'); + assert.strictEqual(parsedBody.metadata.layers[4].type, 'torque'); keysToDelete['map_cfg|' + LayergroupToken.parse(parsedBody.layergroupid).token] = 0; keysToDelete['user:localhost:mapviews:global'] = 5; @@ -805,8 +805,8 @@ describe('named_layers', function () { assert.ok(parsedBody.layergroupid); assert.ok(parsedBody.last_updated); - assert.equal(parsedBody.metadata.layers[0].type, 'mapnik'); - assert.equal(parsedBody.metadata.layers[1].type, 'mapnik'); + assert.strictEqual(parsedBody.metadata.layers[0].type, 'mapnik'); + assert.strictEqual(parsedBody.metadata.layers[1].type, 'mapnik'); keysToDelete['map_cfg|' + LayergroupToken.parse(parsedBody.layergroupid).token] = 0; keysToDelete['user:localhost:mapviews:global'] = 5; diff --git a/test/acceptance/named-maps-authentication-test.js b/test/acceptance/named-maps-authentication-test.js index 88a7fba7..687ec779 100644 --- a/test/acceptance/named-maps-authentication-test.js +++ b/test/acceptance/named-maps-authentication-test.js @@ -191,8 +191,8 @@ describe('named maps authentication', function () { it('should return 200 if properly authorized', function (done) { getNamedTile(tokenAuthTemplateName, 0, 0, 0, { params: { auth_token: 'valid1' } }, function (err, res, img) { - assert.equal(img.width(), 256); - assert.equal(img.height(), 256); + assert.strictEqual(img.width(), 256); + assert.strictEqual(img.height(), 256); assert.ok(!err); test_helper.checkSurrogateKey(res, new NamedMapsCacheEntry(username, tokenAuthTemplateName).key()); @@ -261,8 +261,8 @@ describe('named maps authentication', function () { getStaticMap(tokenAuthTemplateName, { params: { auth_token: 'valid1' } }, function (err, res, img) { assert.ok(!err); - assert.equal(img.width(), 640); - assert.equal(img.height(), 480); + assert.strictEqual(img.width(), 640); + assert.strictEqual(img.height(), 480); test_helper.checkSurrogateKey(res, new NamedMapsCacheEntry(username, tokenAuthTemplateName).key()); test_helper.deleteRedisKeys({ 'user:localhost:mapviews:global': 5 }, done); diff --git a/test/acceptance/named-maps-stats-test.js b/test/acceptance/named-maps-stats-test.js index 086ca354..94a400a9 100644 --- a/test/acceptance/named-maps-stats-test.js +++ b/test/acceptance/named-maps-stats-test.js @@ -103,8 +103,8 @@ describe('named maps preview stats', function () { getStaticMap(templateName, { params: { auth_token: 'valid1' } }, function (err, res, img) { assert.ok(!err); - assert.equal(img.width(), 640); - assert.equal(img.height(), 480); + assert.strictEqual(img.width(), 640); + assert.strictEqual(img.height(), 480); test_helper.checkSurrogateKey(res, new NamedMapsCacheEntry(username, templateName).key()); var redisKeysToDelete = { 'user:localhost:mapviews:global': 5 }; diff --git a/test/acceptance/overviews-metadata-named-maps-test.js b/test/acceptance/overviews-metadata-named-maps-test.js index 26ac9fd1..b231aa20 100644 --- a/test/acceptance/overviews-metadata-named-maps-test.js +++ b/test/acceptance/overviews-metadata-named-maps-test.js @@ -82,7 +82,7 @@ describe('overviews metadata for named maps', function () { assert.ifError(err); var next = this; - assert.equal(res.statusCode, 200); + assert.strictEqual(res.statusCode, 200); assert.deepEqual(JSON.parse(res.body), { template_id: templateId }); @@ -109,7 +109,7 @@ describe('overviews metadata for named maps', function () { var next = this; - assert.equal(res.statusCode, 200); + assert.strictEqual(res.statusCode, 200); var parsedBody = JSON.parse(res.body); @@ -134,7 +134,7 @@ describe('overviews metadata for named maps', function () { mapStore.load(LayergroupToken.parse(layergroupId).token, function (err, mapConfig) { assert.ifError(err); assert.deepEqual(non_overviews_layer, mapConfig._cfg.layers[1]); - assert.equal(mapConfig._cfg.layers[0].type, 'cartodb'); + assert.strictEqual(mapConfig._cfg.layers[0].type, 'cartodb'); assert.ok(mapConfig._cfg.layers[0].options.query_rewrite_data); var expected_data = { overviews: { @@ -165,7 +165,7 @@ describe('overviews metadata for named maps', function () { }, function checkDeleteTemplate (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 204); + assert.strictEqual(res.statusCode, 204); assert.ok(!res.body); return null; @@ -220,7 +220,7 @@ describe('overviews metadata for named maps', function () { const headers = JSON.parse(res.headers['x-tiler-profiler']); assert.ok(headers.overviewsAddedToMapconfig); - assert.equal(headers.mapType, 'named'); + assert.strictEqual(headers.mapType, 'named'); next(); }, @@ -285,8 +285,8 @@ describe('overviews metadata for named maps', function () { const headers = JSON.parse(res.headers['x-tiler-profiler']); - assert.equal(headers.overviewsAddedToMapconfig, false); - assert.equal(headers.mapType, 'named'); + assert.strictEqual(headers.overviewsAddedToMapconfig, false); + assert.strictEqual(headers.mapType, 'named'); next(); }, diff --git a/test/acceptance/overviews-metadata-test.js b/test/acceptance/overviews-metadata-test.js index 51ad4d97..1174011f 100644 --- a/test/acceptance/overviews-metadata-test.js +++ b/test/acceptance/overviews-metadata-test.js @@ -70,10 +70,10 @@ describe('overviews metadata', function () { headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(layergroup) }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsedBody = JSON.parse(res.body); - assert.equal(res.headers['x-layergroup-id'], parsedBody.layergroupid); + assert.strictEqual(res.headers['x-layergroup-id'], parsedBody.layergroupid); expected_token = parsedBody.layergroupid; next(null, res); }); @@ -89,7 +89,7 @@ describe('overviews metadata', function () { mapStore.load(LayergroupToken.parse(expected_token).token, function (err, mapConfig) { assert.ifError(err); assert.deepEqual(non_overviews_layer, mapConfig._cfg.layers[1]); - assert.equal(mapConfig._cfg.layers[0].type, 'cartodb'); + assert.strictEqual(mapConfig._cfg.layers[0].type, 'cartodb'); assert.ok(mapConfig._cfg.layers[0].options.query_rewrite_data); var expected_data = { overviews: { @@ -132,12 +132,12 @@ describe('overviews metadata', function () { headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(layergroup) }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); const headers = JSON.parse(res.headers['x-tiler-profiler']); assert.ok(headers.overviewsAddedToMapconfig); - assert.equal(headers.mapType, 'anonymous'); + assert.strictEqual(headers.mapType, 'anonymous'); const parsedBody = JSON.parse(res.body); expected_token = parsedBody.layergroupid; @@ -169,12 +169,12 @@ describe('overviews metadata', function () { headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(layergroup) }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); const headers = JSON.parse(res.headers['x-tiler-profiler']); - assert.equal(headers.overviewsAddedToMapconfig, false); - assert.equal(headers.mapType, 'anonymous'); + assert.strictEqual(headers.overviewsAddedToMapconfig, false); + assert.strictEqual(headers.mapType, 'anonymous'); const parsedBody = JSON.parse(res.body); expected_token = parsedBody.layergroupid; @@ -264,9 +264,9 @@ describe('overviews metadata with filters', function () { headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(layergroup) }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsedBody = JSON.parse(res.body); - assert.equal(res.headers['x-layergroup-id'], parsedBody.layergroupid); + assert.strictEqual(res.headers['x-layergroup-id'], parsedBody.layergroupid); expected_token = parsedBody.layergroupid; next(null, res); }); @@ -281,7 +281,7 @@ describe('overviews metadata with filters', function () { }); mapStore.load(LayergroupToken.parse(expected_token).token, function (err, mapConfig) { assert.ifError(err); - assert.equal(mapConfig._cfg.layers[0].type, 'cartodb'); + assert.strictEqual(mapConfig._cfg.layers[0].type, 'cartodb'); assert.ok(mapConfig._cfg.layers[0].options.query_rewrite_data); var expected_data = { overviews: { diff --git a/test/acceptance/ported/attributes-test.js b/test/acceptance/ported/attributes-test.js index 28f9ccd6..ee269cf9 100644 --- a/test/acceptance/ported/attributes-test.js +++ b/test/acceptance/ported/attributes-test.js @@ -40,11 +40,11 @@ describe('attributes', function () { }; function checkCORSHeaders (res) { - assert.equal( + assert.strictEqual( res.headers['access-control-allow-headers'], 'X-Requested-With, X-Prototype-Version, X-CSRF-Token, Authorization' ); - assert.equal(res.headers['access-control-allow-origin'], '*'); + assert.strictEqual(res.headers['access-control-allow-origin'], '*'); } var keysToDelete; @@ -74,7 +74,7 @@ describe('attributes', function () { }, function checkPost (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); // CORS headers should be sent with response // from layergroup creation via POST checkCORSHeaders(res); @@ -99,13 +99,13 @@ describe('attributes', function () { }, function check_error_0 (err, res) { assert.ifError(err); - assert.equal( + assert.strictEqual( res.statusCode, 400, res.statusCode + (res.statusCode !== 200 ? (': ' + res.body) : '') ); var parsed = JSON.parse(res.body); - assert.equal(parsed.errors[0], 'Layer 0 has no exposed attributes'); + assert.strictEqual(parsed.errors[0], 'Layer 0 has no exposed attributes'); return null; }, function do_get_attr_1 (err) { @@ -121,7 +121,7 @@ describe('attributes', function () { }, function check_attr_1 (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.deepEqual(parsed, { n: 6 }); return null; @@ -139,11 +139,11 @@ describe('attributes', function () { }, function check_attr_1_404 (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 404, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 404, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.errors); var msg = parsed.errors[0]; - assert.equal(msg, "Multiple features (0) identified by 'i' = -666 in layer 1"); + assert.strictEqual(msg, "Multiple features (0) identified by 'i' = -666 in layer 1"); return null; }, function finish (err) { @@ -179,12 +179,12 @@ describe('attributes', function () { }, function checkPost (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 404, res.statusCode + ': ' + (res.statusCode === 200 ? '...' : res.body)); + assert.strictEqual(res.statusCode, 404, res.statusCode + ': ' + (res.statusCode === 200 ? '...' : res.body)); var parsed = JSON.parse(res.body); assert.ok(parsed.errors); - assert.equal(parsed.errors.length, 1); + assert.strictEqual(parsed.errors.length, 1); var msg = parsed.errors[0]; - assert.equal(msg, 'column "unexistant" does not exist'); + assert.strictEqual(msg, 'column "unexistant" does not exist'); return null; }, function finish (err) { @@ -210,7 +210,7 @@ describe('attributes', function () { }, function checkPost (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); // CORS headers should be sent with response // from layergroup creation via POST checkCORSHeaders(res); @@ -237,8 +237,8 @@ describe('attributes', function () { function check_error_0 (err, res) { assert.ifError(err); // jsonp errors should be returned with HTTP status 200 - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); - assert.equal( + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual( res.body, '/**/ typeof test === \'function\' && ' + 'test({"errors":["Layer 0 has no exposed attributes"],' + @@ -261,7 +261,7 @@ describe('attributes', function () { }, function check_attr_1 (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.deepEqual(parsed, { n: 6 }); return null; @@ -302,12 +302,12 @@ describe('attributes', function () { function checkPost (err, res) { assert.ifError(err); // TODO: should be 403 Forbidden - assert.equal(res.statusCode, 400, res.statusCode + ': ' + (res.statusCode === 200 ? '...' : res.body)); + assert.strictEqual(res.statusCode, 400, res.statusCode + ': ' + (res.statusCode === 200 ? '...' : res.body)); var parsed = JSON.parse(res.body); assert.ok(parsed.errors); - assert.equal(parsed.errors.length, 1); + assert.strictEqual(parsed.errors.length, 1); var msg = parsed.errors[0]; - assert.equal(msg, 'cannot execute INSERT in a read-only transaction'); + assert.strictEqual(msg, 'cannot execute INSERT in a read-only transaction'); return null; }, function finish (err) { diff --git a/test/acceptance/ported/blend-http-timeout-test.js b/test/acceptance/ported/blend-http-timeout-test.js index d7d63bb9..11d82f66 100644 --- a/test/acceptance/ported/blend-http-timeout-test.js +++ b/test/acceptance/ported/blend-http-timeout-test.js @@ -72,7 +72,7 @@ describe.skip('blend http client timeout', function () { var parsedBody = JSON.parse(res.body); assert.ok(parsedBody.errors); assert.ok(parsedBody.errors.length); - assert.equal(parsedBody.errors[0], 'Unable to fetch http tile: http://127.0.0.1:8033/light/0/0/0.png'); + assert.strictEqual(parsedBody.errors[0], 'Unable to fetch http tile: http://127.0.0.1:8033/light/0/0/0.png'); finish(function (finishErr) { done(err || finishErr); }); diff --git a/test/acceptance/ported/external-resources-test.js b/test/acceptance/ported/external-resources-test.js index 0890bdc8..cbee2d81 100644 --- a/test/acceptance/ported/external-resources-test.js +++ b/test/acceptance/ported/external-resources-test.js @@ -95,7 +95,7 @@ describe('external resources', function () { var externalResourceRequestsCount = res_serv_status.numrequests; testClient.createLayergroup(externalResourceMapConfig, options, function () { - assert.equal(res_serv_status.numrequests, externalResourceRequestsCount); + assert.strictEqual(res_serv_status.numrequests, externalResourceRequestsCount); // reset resources cache testHelper.rmdirRecursiveSync(global.environment.millstone.cache_basedir); @@ -103,7 +103,7 @@ describe('external resources', function () { externalResourceMapConfig = testClient.defaultTableMapConfig('test_table_3 ', externalResourceStyle); testClient.createLayergroup(externalResourceMapConfig, options, function () { - assert.equal(res_serv_status.numrequests, externalResourceRequestsCount + 1); + assert.strictEqual(res_serv_status.numrequests, externalResourceRequestsCount + 1); done(); }); diff --git a/test/acceptance/ported/multilayer-error-cases-test.js b/test/acceptance/ported/multilayer-error-cases-test.js index 511abb28..bc6f38bf 100644 --- a/test/acceptance/ported/multilayer-error-cases-test.js +++ b/test/acceptance/ported/multilayer-error-cases-test.js @@ -34,7 +34,7 @@ describe('multilayer error cases', function () { 'Content-Type': 'application/x-www-form-urlencoded' } }, {}, function (res) { - assert.equal(res.statusCode, 400, res.body); + assert.strictEqual(res.statusCode, 400, res.body); var parsedBody = JSON.parse(res.body); assert.deepEqual(parsedBody.errors, ['POST data must be of type application/json']); done(); @@ -50,7 +50,7 @@ describe('multilayer error cases', function () { 'Content-Type': 'application/json' } }, {}, function (res) { - assert.equal(res.statusCode, 400, res.body); + assert.strictEqual(res.statusCode, 400, res.body); var parsedBody = JSON.parse(res.body); assert.deepEqual(parsedBody.errors, ['Missing layers array from layergroup config']); done(); @@ -66,8 +66,8 @@ describe('multilayer error cases', function () { 'Content-Type': 'application/json' } }, {}, function (res) { - assert.equal(res.statusCode, 200); - assert.equal( + assert.strictEqual(res.statusCode, 200); + assert.strictEqual( res.body, '/**/ typeof test === \'function\' && ' + 'test({"errors":["Missing layers array from layergroup config"],' + @@ -100,7 +100,7 @@ describe('multilayer error cases', function () { }, data: JSON.stringify(layergroup) }, {}, function (res) { - assert.equal(res.statusCode, 400, res.body); + assert.strictEqual(res.statusCode, 400, res.body); var parsedBody = JSON.parse(res.body); assert.deepEqual(parsedBody.errors, ['Missing cartocss_version for layer 0 options']); done(); @@ -129,11 +129,11 @@ describe('multilayer error cases', function () { data: JSON.stringify(layergroup) }, {}, function (res) { try { - assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 400, res.statusCode + ': ' + res.body); // See http://github.com/CartoDB/Windshaft/issues/159 var parsed = JSON.parse(res.body); assert.ok(parsed); - assert.equal(parsed.errors.length, 1); + assert.strictEqual(parsed.errors.length, 1); var error = parsed.errors[0]; assert.ok(error.match(/column "missing" does not exist/m), error); // cannot check for error starting with style0 until a new enough mapnik @@ -181,7 +181,7 @@ describe('multilayer error cases', function () { this.client.getLayergroup({ response: { status: 400 } }, function (err, parsed) { assert.ok(!err, err); assert.ok(parsed); - assert.equal(parsed.errors.length, 1); + assert.strictEqual(parsed.errors.length, 1); var error = parsed.errors[0]; assert.ok(error.match(/column "missing" does not exist/m), error); done(); @@ -222,10 +222,10 @@ describe('multilayer error cases', function () { data: JSON.stringify(layergroup) }, {}, function (res) { try { - assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 400, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed); - assert.equal(parsed.errors.length, 1); + assert.strictEqual(parsed.errors.length, 1); var error = parsed.errors[0]; assert.ok(error.match(/^style1: CartoCSS is empty/), error); done(); @@ -265,10 +265,10 @@ describe('multilayer error cases', function () { data: JSON.stringify(layergroup) }, {}, function (res) { try { - assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 400, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed); - assert.equal(parsed.errors.length, 1); + assert.strictEqual(parsed.errors.length, 1); var error = parsed.errors[0]; // carto-0.9.3 used to say "Failed to parse expression", // carto-0.9.5 says "not a valid keyword" @@ -313,9 +313,9 @@ describe('multilayer error cases', function () { }, data: JSON.stringify(layergroup) }, {}, function (res) { - assert.equal(res.statusCode, 400, res.body); + assert.strictEqual(res.statusCode, 400, res.body); var parsed = JSON.parse(res.body); - assert.equal(parsed.errors.length, 1); + assert.strictEqual(parsed.errors.length, 1); var error = parsed.errors[0]; assert.ok(error.match(/column "address" does not exist/m), error); done(); @@ -421,7 +421,7 @@ describe('multilayer error cases', function () { function checkResponse (err, res) { assert.ifError(err); // FIXME: should be 404 - assert.equal(res.statusCode, 400, res.statusCode + ':' + res.body); + assert.strictEqual(res.statusCode, 400, res.statusCode + ':' + res.body); var parsed = JSON.parse(res.body); assert.deepEqual(parsed.errors, ["Invalid or nonexistent map configuration token 'deadbeef'"]); return null; @@ -457,7 +457,7 @@ describe('multilayer error cases', function () { function (res) { var parsedBody = JSON.parse(res.body); assert.ok(parsedBody.errors); - assert.equal(parsedBody.errors.length, 1); + assert.strictEqual(parsedBody.errors.length, 1); assert.ok(parsedBody.errors[0].match(/^SyntaxError: Unexpected token {/)); done(); } diff --git a/test/acceptance/ported/multilayer-interactivity-test.js b/test/acceptance/ported/multilayer-interactivity-test.js index 62ad07e1..e1f0b121 100644 --- a/test/acceptance/ported/multilayer-interactivity-test.js +++ b/test/acceptance/ported/multilayer-interactivity-test.js @@ -45,7 +45,7 @@ describe('multilayer interactivity and layers order', function () { } }, function (response) { - assert.equal( + assert.strictEqual( response.statusCode, 200, 'Expected status code 200, got ' + response.statusCode + @@ -58,13 +58,13 @@ describe('multilayer interactivity and layers order', function () { var layergroupId = layergroupResponse.layergroupid; assert.ok(layergroupId); - assert.equal(layergroupResponse.metadata.layers.length, layergroup.layers.length); + assert.strictEqual(layergroupResponse.metadata.layers.length, layergroup.layers.length); // check layers metadata at least match in number var layersMetadata = layergroupResponse.metadata.layers; - assert.equal(layersMetadata.length, layergroup.layers.length); + assert.strictEqual(layersMetadata.length, layergroup.layers.length); for (var i = 0, len = layersMetadata.length; i < len; i++) { - assert.equal( + assert.strictEqual( getLayerTypeFn(layersMetadata[i].type), getLayerTypeFn(layergroup.layers[i].type) ); @@ -72,7 +72,7 @@ describe('multilayer interactivity and layers order', function () { // check torque metadata at least match in number var torqueLayers = layergroup.layers.filter(function (layer) { return layer.type === 'torque'; }); if (torqueLayers.length) { - assert.equal(Object.keys(layergroupResponse.metadata.torque).length, torqueLayers.length); + assert.strictEqual(Object.keys(layergroupResponse.metadata.torque).length, torqueLayers.length); } var keysToDelete = { diff --git a/test/acceptance/ported/multilayer-test.js b/test/acceptance/ported/multilayer-test.js index eb26d511..792feb2d 100644 --- a/test/acceptance/ported/multilayer-test.js +++ b/test/acceptance/ported/multilayer-test.js @@ -25,11 +25,11 @@ describe('multilayer', function () { var IMAGE_EQUALS_TOLERANCE_PER_MIL = 20; function checkCORSHeaders (res) { - assert.equal( + assert.strictEqual( res.headers['access-control-allow-headers'], 'X-Requested-With, X-Prototype-Version, X-CSRF-Token, Authorization' ); - assert.equal(res.headers['access-control-allow-origin'], '*'); + assert.strictEqual(res.headers['access-control-allow-origin'], '*'); } // See https://github.com/Vizzuality/Windshaft/issues/70 @@ -57,7 +57,7 @@ describe('multilayer', function () { headers: { host: 'localhost', 'Content-Type': 'application/json; charset=utf-8' }, data: JSON.stringify(layergroup) }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsedBody = JSON.parse(res.body); expected_token = LayergroupToken.parse(parsedBody.layergroupid).token; next(); @@ -99,7 +99,7 @@ describe('multilayer', function () { headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(layergroup) }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsedBody = JSON.parse(res.body); expected_token = LayergroupToken.parse(parsedBody.layergroupid).token; next(); @@ -114,8 +114,8 @@ describe('multilayer', function () { encoding: 'binary', headers: { host: 'localhost' } }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'image/png'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'image/png'); checkCORSHeaders(res); var referenceImagePath = './test/fixtures/test_bigpoint_red.png'; assert.imageBufferIsSimilarToFile(res.body, referenceImagePath, IMAGE_EQUALS_TOLERANCE_PER_MIL, @@ -170,7 +170,7 @@ describe('multilayer', function () { headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(layergroup) }, {}, function (res) { - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); // CORS headers should be sent with response // from layergroup creation via POST checkCORSHeaders(res); @@ -192,8 +192,8 @@ describe('multilayer', function () { encoding: 'binary', headers: { host: 'localhost' } }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'image/png'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'image/png'); var referenceImagePath = './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer1.png'; assert.imageBufferIsSimilarToFile(res.body, referenceImagePath, IMAGE_EQUALS_TOLERANCE_PER_MIL, function (err) { @@ -209,8 +209,8 @@ describe('multilayer', function () { method: 'GET', headers: { host: 'localhost' } }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); assert.utfgridEqualsFile( res.body, './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer1.layer0.grid.json', 2, function (err/*, similarity */) { @@ -227,8 +227,8 @@ describe('multilayer', function () { method: 'GET', headers: { host: 'localhost' } }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); assert.utfgridEqualsFile( res.body, './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer1.layer1.grid.json', 2, function (err/*, similarity */) { @@ -283,7 +283,7 @@ describe('multilayer', function () { method: 'GET', headers: { host: 'localhost', 'Content-Type': 'application/json' } }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); // CORS headers should be sent with response // from layergroup creation via GET // see https://github.com/CartoDB/Windshaft/issues/92 @@ -306,8 +306,8 @@ describe('multilayer', function () { encoding: 'binary', headers: { host: 'localhost' } }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'image/png'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'image/png'); var referenceImagePath = './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer1.png'; assert.imageBufferIsSimilarToFile(res.body, referenceImagePath, IMAGE_EQUALS_TOLERANCE_PER_MIL, function (err) { @@ -324,8 +324,8 @@ describe('multilayer', function () { method: 'GET', headers: { host: 'localhost' } }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); assert.utfgridEqualsFile( res.body, './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer1.layer0.grid.json', 2, function (err/*, similarity */) { @@ -342,8 +342,8 @@ describe('multilayer', function () { method: 'GET', headers: { host: 'localhost' } }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); assert.utfgridEqualsFile( res.body, './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer1.layer1.grid.json', 2, function (err/*, similarity */) { @@ -402,7 +402,7 @@ describe('multilayer', function () { }, function do_check_token (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var didRunJsonCallback = false; // jshint ignore:start @@ -432,8 +432,8 @@ describe('multilayer', function () { encoding: 'binary', headers: { host: 'localhost' } }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'image/png'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'image/png'); var referenceImagePath = './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer1.png'; assert.imageBufferIsSimilarToFile(res.body, referenceImagePath, IMAGE_EQUALS_TOLERANCE_PER_MIL, function (err) { @@ -450,8 +450,8 @@ describe('multilayer', function () { method: 'GET', headers: { host: 'localhost' } }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); assert.utfgridEqualsFile( res.body, './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer1.layer0.grid.json', 2, function (err/*, similarity */) { @@ -468,8 +468,8 @@ describe('multilayer', function () { method: 'GET', headers: { host: 'localhost' } }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); assert.utfgridEqualsFile( res.body, './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer1.layer1.grid.json', 2, function (err/*, similarity */) { @@ -540,7 +540,7 @@ describe('multilayer', function () { }, function check_create (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsed = JSON.parse(res.body); expected_token = LayergroupToken.parse(parsed.layergroupid).token; return null; @@ -554,8 +554,8 @@ describe('multilayer', function () { encoding: 'binary', headers: { host: 'localhost' } }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'image/png'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'image/png'); var referenceImagePath = './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer1.png'; assert.imageBufferIsSimilarToFile(res.body, referenceImagePath, IMAGE_EQUALS_TOLERANCE_PER_MIL, function (err) { @@ -572,8 +572,8 @@ describe('multilayer', function () { method: 'GET', headers: { host: 'localhost' } }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); assert.utfgridEqualsFile( res.body, './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer1.layer0.grid.json', 2, function (err/*, similarity */) { @@ -590,8 +590,8 @@ describe('multilayer', function () { method: 'GET', headers: { host: 'localhost' } }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); assert.utfgridEqualsFile( res.body, './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer1.layer1.grid.json', 2, function (err/*, similarity */) { @@ -612,8 +612,8 @@ describe('multilayer', function () { }, function do_check_attr1 (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); var parsed = JSON.parse(res.body); assert.deepEqual(parsed, { n: 40 }); return null; @@ -629,13 +629,13 @@ describe('multilayer', function () { }, function do_check_torque2 (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); var parsed = JSON.parse(res.body); assert.deepEqual(parsed[0].vals__uint8, [1]); assert.deepEqual(parsed[0].dates__uint16, [0]); - assert.equal(parsed[0].x__uint8, 128); - assert.equal(parsed[0].y__uint8, 128); + assert.strictEqual(parsed[0].x__uint8, 128); + assert.strictEqual(parsed[0].y__uint8, 128); return null; }, function do_get_torque1 (err) { @@ -651,10 +651,10 @@ describe('multilayer', function () { }, function do_check_torque1 (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 400, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.errors, res.body); - assert.equal(parsed.errors.length, 1); + assert.strictEqual(parsed.errors.length, 1); var msg = parsed.errors[0]; assert.ok(msg.match(/Unsupported format json.torque/i), msg); return null; @@ -711,7 +711,7 @@ describe('multilayer', function () { headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(layergroup1) }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsedBody = JSON.parse(res.body); token1 = LayergroupToken.parse(parsedBody.layergroupid).token; assert.ok(token1, res.body); @@ -726,7 +726,7 @@ describe('multilayer', function () { headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(layergroup2) }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsedBody = JSON.parse(res.body); token2 = LayergroupToken.parse(parsedBody.layergroupid).token; assert.ok(token2); @@ -742,8 +742,8 @@ describe('multilayer', function () { encoding: 'binary', headers: { host: 'localhost' } }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'image/png'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'image/png'); var referenceImagePath = './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer2.png'; assert.imageBufferIsSimilarToFile(res.body, referenceImagePath, IMAGE_EQUALS_TOLERANCE_PER_MIL, function (err) { @@ -759,8 +759,8 @@ describe('multilayer', function () { method: 'GET', headers: { host: 'localhost' } }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); assert.utfgridEqualsFile( res.body, './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer1.layer0.grid.json', 2, function (err/*, similarity */) { @@ -777,8 +777,8 @@ describe('multilayer', function () { encoding: 'binary', headers: { host: 'localhost' } }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'image/png'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'image/png'); var referenceImagePath = './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer3.png'; assert.imageBufferIsSimilarToFile(res.body, referenceImagePath, IMAGE_EQUALS_TOLERANCE_PER_MIL, function (err) { @@ -794,8 +794,8 @@ describe('multilayer', function () { method: 'GET', headers: { host: 'localhost' } }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); assert.utfgridEqualsFile( res.body, './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer1.layer1.grid.json', 2, function (err/*, similarity */) { @@ -857,7 +857,7 @@ describe('multilayer', function () { data: JSON.stringify(layergroup) }, {}, function (res) { try { - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsedBody = JSON.parse(res.body); if (expected_token) { assert.deepEqual(parsedBody, { layergroupid: expected_token, layercount: 3 }); @@ -877,8 +877,8 @@ describe('multilayer', function () { encoding: 'binary', headers: { host: 'localhost' } }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'image/png'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'image/png'); var referenceImagePath = './test/acceptance/ported/fixtures/test_table_0_0_0_multilayer4.png'; assert.imageBufferIsSimilarToFile(res.body, referenceImagePath, IMAGE_EQUALS_TOLERANCE_PER_MIL, function (err) { @@ -926,7 +926,7 @@ describe('multilayer', function () { headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(layergroup) }, {}, function (res) { - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); var expected_token = LayergroupToken.parse(parsed.layergroupid).token; var keysToDelete = { 'user:localhost:mapviews:global': 5 }; @@ -956,7 +956,7 @@ describe('multilayer', function () { headers: { host: 'localhost', 'Content-Type': 'application/json' }, data: JSON.stringify(layergroup) }, {}, function (res) { - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); var expected_token = LayergroupToken.parse(parsed.layergroupid).token; var keysToDelete = { 'user:localhost:mapviews:global': 5 }; @@ -995,9 +995,9 @@ describe('multilayer', function () { }, function checkBadFont (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 400, res.statusCode + ': ' + res.body); var parsedBody = JSON.parse(res.body); - assert.equal(parsedBody.errors.length, 1); + assert.strictEqual(parsedBody.errors.length, 1); var errmsg = parsedBody.errors[0]; assert.ok(errmsg.match(/text-face-name.*bogus/), parsedBody.errors.toString()); //, {"errors":["style0: Failed to find font face 'bogus'"]}); @@ -1015,7 +1015,7 @@ describe('multilayer', function () { }, function checkGoodFont (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); var expected_token = LayergroupToken.parse(parsed.layergroupid).token; var keysToDelete = { 'user:localhost:mapviews:global': 5 }; @@ -1076,7 +1076,7 @@ describe('multilayer', function () { data: JSON.stringify(layergroup) }, {}, function (res) { try { - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsedBody = JSON.parse(res.body); if (expected_token) { assert.deepEqual(parsedBody, { layergroupid: expected_token, layercount: 3 }); @@ -1101,8 +1101,8 @@ describe('multilayer', function () { function do_check_grid (err, res) { assert.ifError(err); var next = this; - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); var grid = JSON.parse(res.body); assert.ok(grid); assert.ok(grid.hasOwnProperty('data')); @@ -1153,7 +1153,7 @@ describe('multilayer', function () { }, function check_post_1 (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); var parsedBody = JSON.parse(res.body); token1 = LayergroupToken.parse(parsedBody.layergroupid).token; return null; @@ -1169,7 +1169,7 @@ describe('multilayer', function () { }, function check_post_2 (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); var parsedBody = JSON.parse(res.body); token2 = LayergroupToken.parse(parsedBody.layergroupid).token; assert.ok(token1 !== token2); @@ -1216,7 +1216,7 @@ describe('multilayer', function () { }, function check_post_1 (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); var parsedBody = JSON.parse(res.body); token1 = LayergroupToken.parse(parsedBody.layergroupid).token; return null; @@ -1230,8 +1230,8 @@ describe('multilayer', function () { encoding: 'binary', headers: { host: 'localhost' } }, {}, function (res) { - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'image/png'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'image/png'); checkCORSHeaders(res); assert.imageBufferIsSimilarToFile(res.body, './test/fixtures/test_bigpoint_red.png', IMAGE_EQUALS_TOLERANCE_PER_MIL, function (err) { diff --git a/test/acceptance/ported/raster-test.js b/test/acceptance/ported/raster-test.js index f6e44e9e..059ee0f6 100644 --- a/test/acceptance/ported/raster-test.js +++ b/test/acceptance/ported/raster-test.js @@ -17,11 +17,11 @@ describe('raster', function () { }); function checkCORSHeaders (res) { - assert.equal( + assert.strictEqual( res.headers['access-control-allow-headers'], 'X-Requested-With, X-Prototype-Version, X-CSRF-Token, Authorization' ); - assert.equal(res.headers['access-control-allow-origin'], '*'); + assert.strictEqual(res.headers['access-control-allow-origin'], '*'); } var IMAGE_EQUALS_TOLERANCE_PER_MIL = 2; @@ -57,7 +57,7 @@ describe('raster', function () { }, function checkPost (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); // CORS headers should be sent with response // from layergroup creation via POST checkCORSHeaders(res); @@ -81,7 +81,7 @@ describe('raster', function () { }, function check_response (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); assert.deepEqual(res.headers['content-type'], 'image/png'); var next = this; assert.imageBufferIsSimilarToFile(res.body, diff --git a/test/acceptance/ported/regressions-test.js b/test/acceptance/ported/regressions-test.js index a3e7100a..cd73fde2 100644 --- a/test/acceptance/ported/regressions-test.js +++ b/test/acceptance/ported/regressions-test.js @@ -30,7 +30,7 @@ describe('regressions', function () { testClient.getTile(writeSqlMapConfig, 0, 0, 0, expectedResponse, function (err, res) { var parsedBody = JSON.parse(res.body); assert.ok(parsedBody.errors); - assert.equal(parsedBody.errors.length, 1); + assert.strictEqual(parsedBody.errors.length, 1); assert.ok(parsedBody.errors[0].match(/read-only transaction/), 'read-only error message expected'); done(); }); diff --git a/test/acceptance/ported/retina-test.js b/test/acceptance/ported/retina-test.js index 843ad9b4..690cf9df 100644 --- a/test/acceptance/ported/retina-test.js +++ b/test/acceptance/ported/retina-test.js @@ -93,8 +93,8 @@ describe('retina support', function () { var image = new mapnik.Image.fromBytes(new Buffer(res.body, 'binary')); - assert.equal(image.width(), imageSize); - assert.equal(image.height(), imageSize); + assert.strictEqual(image.width(), imageSize); + assert.strictEqual(image.height(), imageSize); done(); } ); diff --git a/test/acceptance/ported/server-png8-format-test.js b/test/acceptance/ported/server-png8-format-test.js index 1de59d8c..dd02f36b 100644 --- a/test/acceptance/ported/server-png8-format-test.js +++ b/test/acceptance/ported/server-png8-format-test.js @@ -102,10 +102,10 @@ describe('server_png8_format', function () { }; assert.response(serverPng32, requestPayload, requestHeaders, function (responsePng32) { - assert.equal(responsePng32.headers['content-type'], 'image/png'); + assert.strictEqual(responsePng32.headers['content-type'], 'image/png'); bufferPng32 = responsePng32.body; assert.response(serverPng8, requestPayload, requestHeaders, function (responsePng8) { - assert.equal(responsePng8.headers['content-type'], 'image/png'); + assert.strictEqual(responsePng8.headers['content-type'], 'image/png'); bufferPng8 = responsePng8.body; assert.ok(bufferPng8.length < bufferPng32.length); assert.imageBuffersAreSimilar(bufferPng32, bufferPng8, IMAGE_EQUALS_TOLERANCE_PER_MIL, diff --git a/test/acceptance/ported/server-test.js b/test/acceptance/ported/server-test.js index 609934ac..477cd796 100644 --- a/test/acceptance/ported/server-test.js +++ b/test/acceptance/ported/server-test.js @@ -67,7 +67,7 @@ describe('server', function () { it('grid jsonp', function (done) { var mapConfig = testClient.singleLayerMapConfig('select * from test_table', null, null, 'name'); testClient.getGridJsonp(mapConfig, 0, 13, 4011, 3088, 'jsonp_test', function (err, res) { - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); assert.deepEqual(res.headers['content-type'], 'text/javascript; charset=utf-8'); var didRunJsonCallback = false; var response = {}; diff --git a/test/acceptance/ported/static-maps-test.js b/test/acceptance/ported/static-maps-test.js index 4b807ff2..ddc72c01 100644 --- a/test/acceptance/ported/static-maps-test.js +++ b/test/acceptance/ported/static-maps-test.js @@ -66,8 +66,8 @@ describe('static_maps', function () { return done(err); } - assert.equal(image.width(), width); - assert.equal(image.height(), height); + assert.strictEqual(image.width(), width); + assert.strictEqual(image.height(), height); done(); }); @@ -80,8 +80,8 @@ describe('static_maps', function () { return done(err); } - assert.equal(image.width(), width); - assert.equal(image.height(), height); + assert.strictEqual(image.width(), width); + assert.strictEqual(image.height(), height); done(); }); @@ -101,8 +101,8 @@ describe('static_maps', function () { return done(err); } - assert.equal(image.width(), bbWidth); - assert.equal(image.height(), bbHeight); + assert.strictEqual(image.width(), bbWidth); + assert.strictEqual(image.height(), bbHeight); done(); }); @@ -116,8 +116,8 @@ describe('static_maps', function () { return done(err); } - assert.equal(image.width(), width); - assert.equal(image.height(), outOfRangeHeight); + assert.strictEqual(image.width(), width); + assert.strictEqual(image.height(), outOfRangeHeight); done(); }); diff --git a/test/acceptance/ported/torque-boundaries-test.js b/test/acceptance/ported/torque-boundaries-test.js index ef56d310..25ebe9b5 100644 --- a/test/acceptance/ported/torque-boundaries-test.js +++ b/test/acceptance/ported/torque-boundaries-test.js @@ -264,8 +264,8 @@ describe('torque boundary points', function () { }, {}, function (res, err) { assert.ok(!err, 'Failed to get json'); - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); var parsed = JSON.parse(res.body); /* Order the JSON first by descending x__uint8 and ascending * y__uint8 */ @@ -278,7 +278,7 @@ describe('torque boundary points', function () { var i = 0; tileRequest.expects.forEach(function (expected) { - assert.equal( + assert.strictEqual( parsed[i].x__uint8, expected.x__uint8, parsed[i].x__uint8 + ' == ' + expected.x__uint8 + @@ -287,7 +287,7 @@ describe('torque boundary points', function () { '\nEXPECTED\n--------' + '\n' + JSON.stringify(tileRequest.expects, null, 4) ); - assert.equal( + assert.strictEqual( parsed[i].y__uint8, expected.y__uint8, parsed[i].y__uint8 + ' == ' + expected.y__uint8 + @@ -299,7 +299,7 @@ describe('torque boundary points', function () { var j = 0; expected.vals__uint8.forEach(function (val) { - assert.equal( + assert.strictEqual( parsed[i].vals__uint8[j], val.v, 'desc: ' + val.d + @@ -320,7 +320,7 @@ describe('torque boundary points', function () { i++; }); - assert.equal( + assert.strictEqual( parsed.length, tileRequest.expects.length, 'Number of points did not match ' + diff --git a/test/acceptance/ported/torque-png-test.js b/test/acceptance/ported/torque-png-test.js index 578928c7..7a875e28 100644 --- a/test/acceptance/ported/torque-png-test.js +++ b/test/acceptance/ported/torque-png-test.js @@ -133,8 +133,8 @@ describe('torque png renderer', function () { return done(err); } - assert.equal(img.width(), w); - assert.equal(img.height(), h); + assert.strictEqual(img.width(), w); + assert.strictEqual(img.height(), h); done(); }); diff --git a/test/acceptance/ported/torque-test.js b/test/acceptance/ported/torque-test.js index 5dc9ed8f..a4ebe6f7 100644 --- a/test/acceptance/ported/torque-test.js +++ b/test/acceptance/ported/torque-test.js @@ -28,11 +28,11 @@ describe('torque', function () { }); function checkCORSHeaders (res) { - assert.equal( + assert.strictEqual( res.headers['access-control-allow-headers'], 'X-Requested-With, X-Prototype-Version, X-CSRF-Token, Authorization' ); - assert.equal(res.headers['access-control-allow-origin'], '*'); + assert.strictEqual(res.headers['access-control-allow-origin'], '*'); } it('missing required property from torque layer', function (done) { @@ -63,11 +63,11 @@ describe('torque', function () { }, function checkResponse (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 400, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.errors, parsed); var error = parsed.errors[0]; - assert.equal(error, + assert.strictEqual(error, "Missing required property '-torque-frame-count' in torque layer CartoCSS"); return null; }, @@ -85,11 +85,11 @@ describe('torque', function () { }, function checkResponse2 (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 400, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.errors, parsed); var error = parsed.errors[0]; - assert.equal(error, + assert.strictEqual(error, "Missing required property '-torque-resolution' in torque layer CartoCSS"); return null; }, @@ -107,11 +107,11 @@ describe('torque', function () { }, function checkResponse3 (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 400, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.errors, parsed); var error = parsed.errors[0]; - assert.equal(error, + assert.strictEqual(error, "Missing required property '-torque-aggregation-function' in torque layer CartoCSS"); return null; }, @@ -150,11 +150,11 @@ describe('torque', function () { }, function checkResponse (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 400, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.errors, parsed); var error = parsed.errors[0]; - assert.equal(error, 'Something meaningful here'); + assert.strictEqual(error, 'Something meaningful here'); return null; }, function finish (err) { @@ -194,7 +194,7 @@ describe('torque', function () { }, function checkPost (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); // CORS headers should be sent with response // from layergroup creation via POST checkCORSHeaders(res); @@ -215,8 +215,8 @@ describe('torque', function () { 'No layer 0 in "torque" in metadata:' + JSON.stringify(tm)); var expectedTorqueMetadata = { start: 0, end: 86400000, data_steps: 2, column_type: 'date' }; Object.keys(expectedTorqueMetadata).forEach(function (k) { - assert.equal(tm0[k], expectedTorqueMetadata[k]); - assert.equal(meta.layers[0].meta[k], expectedTorqueMetadata[k]); + assert.strictEqual(tm0[k], expectedTorqueMetadata[k]); + assert.strictEqual(meta.layers[0].meta[k], expectedTorqueMetadata[k]); }); return null; }, @@ -234,10 +234,10 @@ describe('torque', function () { }, function check_mapnik_error_1 (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 400, res.statusCode + (res.statusCode !== 200 ? (': ' + res.body) : '')); + assert.strictEqual(res.statusCode, 400, res.statusCode + (res.statusCode !== 200 ? (': ' + res.body) : '')); var parsed = JSON.parse(res.body); - assert.equal(parsed.errors.length, 1); - assert.equal(parsed.errors[0], "No 'mapnik' layers in MapConfig"); + assert.strictEqual(parsed.errors.length, 1); + assert.strictEqual(parsed.errors[0], "No 'mapnik' layers in MapConfig"); return null; }, function do_get_grid0 (err) { @@ -253,10 +253,10 @@ describe('torque', function () { }, function check_mapnik_error_2 (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 400, res.statusCode + (res.statusCode !== 200 ? (': ' + res.body) : '')); + assert.strictEqual(res.statusCode, 400, res.statusCode + (res.statusCode !== 200 ? (': ' + res.body) : '')); var parsed = JSON.parse(res.body); - assert.equal(parsed.errors.length, 1); - assert.equal(parsed.errors[0], 'Unsupported format grid.json'); + assert.strictEqual(parsed.errors.length, 1); + assert.strictEqual(parsed.errors[0], 'Unsupported format grid.json'); return null; }, function do_get_torque0 (err) { @@ -272,8 +272,8 @@ describe('torque', function () { }, function check_torque0_response (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); var tile_content = [{ x__uint8: 43, y__uint8: 43, vals__uint8: [1, 1], dates__uint16: [0, 1] }]; var parsed = JSON.parse(res.body); assert.deepEqual(tile_content, parsed); @@ -292,8 +292,8 @@ describe('torque', function () { }, function check_torque0_response_1 (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.statusCode, 200, res.body); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); var tile_content = [{ x__uint8: 43, y__uint8: 43, vals__uint8: [1, 1], dates__uint16: [0, 1] }]; var parsed = JSON.parse(res.body); assert.deepEqual(tile_content, parsed); @@ -341,12 +341,12 @@ describe('torque', function () { function checkPost (err, res) { assert.ifError(err); // TODO: should be 403 Forbidden - assert.equal(res.statusCode, 400, res.statusCode + ': ' + (res.statusCode === 200 ? '...' : res.body)); + assert.strictEqual(res.statusCode, 400, res.statusCode + ': ' + (res.statusCode === 200 ? '...' : res.body)); var parsed = JSON.parse(res.body); assert.ok(parsed.errors); - assert.equal(parsed.errors.length, 1); + assert.strictEqual(parsed.errors.length, 1); var msg = parsed.errors[0]; - assert.equal(msg, 'TorqueRenderer: cannot execute INSERT in a read-only transaction'); + assert.strictEqual(msg, 'TorqueRenderer: cannot execute INSERT in a read-only transaction'); return null; }, function finish (err) { @@ -392,11 +392,11 @@ describe('torque', function () { global.environment.postgres.port = defautlPort; - assert.equal(res.statusCode, 500, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 500, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.errors, parsed); var error = parsed.errors[0]; - assert.equal(error, 'TorqueRenderer: cannot connect to the database'); + assert.strictEqual(error, 'TorqueRenderer: cannot connect to the database'); return null; }, function finish (err) { @@ -441,11 +441,11 @@ describe('torque', function () { }, function checkResponse (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 400, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.errors, parsed); var error = parsed.errors[0]; - assert.equal(error, + assert.strictEqual(error, "Unexpected type for property '-torque-aggregation-function', expected string"); done(); return null; diff --git a/test/acceptance/ported/wrap-test.js b/test/acceptance/ported/wrap-test.js index 1a448397..c61c9870 100644 --- a/test/acceptance/ported/wrap-test.js +++ b/test/acceptance/ported/wrap-test.js @@ -111,8 +111,8 @@ describe('wrap x coordinate', function () { testClient.getTile(testClient.defaultTableMapConfig('test_table'), 2, -2, 1, function (err, res, img) { assert.ok(!err); assert.ok(img); - assert.equal(img.width(), 256); - assert.equal(img.height(), 256); + assert.strictEqual(img.width(), 256); + assert.strictEqual(img.height(), 256); done(); }); }); diff --git a/test/acceptance/rate-limit-test.js b/test/acceptance/rate-limit-test.js index c97f9ca8..2964ee86 100644 --- a/test/acceptance/rate-limit-test.js +++ b/test/acceptance/rate-limit-test.js @@ -146,11 +146,11 @@ function assertRateLimitRequest (status, limit, remaining, reset, retry, done) { assert.ifError(err); } else { assert.ok(err); - assert.equal(err.message, 'You are over platform\'s limits: too many requests.' + + assert.strictEqual(err.message, 'You are over platform\'s limits: too many requests.' + ' Please contact us to know more details'); - assert.equal(err.http_status, 429); - assert.equal(err.type, 'limit'); - assert.equal(err.subtype, 'rate-limit'); + assert.strictEqual(err.http_status, 429); + assert.strictEqual(err.type, 'limit'); + assert.strictEqual(err.subtype, 'rate-limit'); } if (done) { @@ -358,10 +358,10 @@ function rateLimitAndVectorTilesTest (usePostGIS) { assert.ifError(err); var tileJSON = tile.toJSON(); - assert.equal(Array.isArray(tileJSON), true); - assert.equal(tileJSON.length, 2); - assert.equal(tileJSON[0].name, 'errorTileSquareLayer'); - assert.equal(tileJSON[1].name, 'errorTileStripesLayer'); + assert.strictEqual(Array.isArray(tileJSON), true); + assert.strictEqual(tileJSON.length, 2); + assert.strictEqual(tileJSON[0].name, 'errorTileSquareLayer'); + assert.strictEqual(tileJSON[1].name, 'errorTileStripesLayer'); done(); } diff --git a/test/acceptance/regressions-test.js b/test/acceptance/regressions-test.js index a66bb990..ad3ed9ce 100644 --- a/test/acceptance/regressions-test.js +++ b/test/acceptance/regressions-test.js @@ -35,8 +35,8 @@ describe('regressions', function () { testClient.getLayergroup({ response: ERROR_RESPONSE }, function (err, layergroupResult) { assert.ok(!err, err); - assert.equal(layergroupResult.errors.length, 1); - assert.equal(layergroupResult.errors[0], 'Missing sql for layer 0 options'); + assert.strictEqual(layergroupResult.errors.length, 1); + assert.strictEqual(layergroupResult.errors[0], 'Missing sql for layer 0 options'); testClient.drain(done); }); @@ -205,8 +205,8 @@ describe('regressions', function () { testClient.getDataview('country_places_count', params, (err, dataview) => { assert.ifError(err); - assert.equal(dataview.type, 'aggregation'); - assert.equal(dataview.categories.length, 1); + assert.strictEqual(dataview.type, 'aggregation'); + assert.strictEqual(dataview.categories.length, 1); assert.deepEqual(dataview.categories[0], { value: 256, category: 'CAN', agg: false }); testClient.drain(done); diff --git a/test/acceptance/server-test.js b/test/acceptance/server-test.js index 95f51f4d..559b369b 100644 --- a/test/acceptance/server-test.js +++ b/test/acceptance/server-test.js @@ -75,7 +75,7 @@ describe('server old_api', function () { method: 'GET', encoding: 'binary' }, {}, function (res) { - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); done(); }); }); diff --git a/test/acceptance/special-numeric-values-test.js b/test/acceptance/special-numeric-values-test.js index 99563019..0e11bdc9 100644 --- a/test/acceptance/special-numeric-values-test.js +++ b/test/acceptance/special-numeric-values-test.js @@ -62,9 +62,9 @@ describe('special numeric values', function () { this.testClient = new TestClient(mapConfig, 1234); this.testClient.getFeatureAttributes(featureId, ATTRIBUTES_LAYER, {}, function (err, attributes) { assert.ifError(err); - assert.equal(attributes.infinity, 'Infinity'); - assert.equal(attributes._infinity, '-Infinity'); - assert.equal(attributes.nan, 'NaN'); + assert.strictEqual(attributes.infinity, 'Infinity'); + assert.strictEqual(attributes._infinity, '-Infinity'); + assert.strictEqual(attributes.nan, 'NaN'); done(); }); }); diff --git a/test/acceptance/stats/mapnik-stats-layergroup-test.js b/test/acceptance/stats/mapnik-stats-layergroup-test.js index 98a2ecac..e55734e2 100644 --- a/test/acceptance/stats/mapnik-stats-layergroup-test.js +++ b/test/acceptance/stats/mapnik-stats-layergroup-test.js @@ -141,8 +141,8 @@ suites.forEach(({ desc, usePostGIS }) => { testClient.getLayergroup(function (err, layergroup) { assert.ifError(err); - assert.equal(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); - assert.equal(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 1); + assert.strictEqual(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); + assert.strictEqual(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 1); testClient.drain(done); }); }); @@ -158,10 +158,10 @@ suites.forEach(({ desc, usePostGIS }) => { testClient.getLayergroup(function (err, layergroup) { assert.ifError(err); - assert.equal(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); - assert.equal(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 1); - assert.equal(layergroup.metadata.layers[1].id, mapnikBasicLayerId(1)); - assert.equal(layergroup.metadata.layers[1].meta.stats.estimatedFeatureCount, 2); + assert.strictEqual(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); + assert.strictEqual(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 1); + assert.strictEqual(layergroup.metadata.layers[1].id, mapnikBasicLayerId(1)); + assert.strictEqual(layergroup.metadata.layers[1].meta.stats.estimatedFeatureCount, 2); testClient.drain(done); }); }); @@ -178,12 +178,12 @@ suites.forEach(({ desc, usePostGIS }) => { testClient.getLayergroup(function (err, layergroup) { assert.ifError(err); - assert.equal(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); - assert.equal(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 1); - assert.equal(layergroup.metadata.layers[1].id, mapnikBasicLayerId(1)); - assert.equal(layergroup.metadata.layers[1].meta.stats.estimatedFeatureCount, 2); - assert.equal(layergroup.metadata.layers[2].id, mapnikBasicLayerId(2)); - assert.equal(layergroup.metadata.layers[2].meta.stats.estimatedFeatureCount, 3); + assert.strictEqual(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); + assert.strictEqual(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 1); + assert.strictEqual(layergroup.metadata.layers[1].id, mapnikBasicLayerId(1)); + assert.strictEqual(layergroup.metadata.layers[1].meta.stats.estimatedFeatureCount, 2); + assert.strictEqual(layergroup.metadata.layers[2].id, mapnikBasicLayerId(2)); + assert.strictEqual(layergroup.metadata.layers[2].meta.stats.estimatedFeatureCount, 3); testClient.drain(done); }); }); @@ -198,8 +198,8 @@ suites.forEach(({ desc, usePostGIS }) => { testClient.getLayergroup(function (err, layergroup) { assert.ifError(err); - assert.equal(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); - assert.equal(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 5); + assert.strictEqual(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); + assert.strictEqual(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 5); testClient.drain(done); }); }); @@ -215,10 +215,10 @@ suites.forEach(({ desc, usePostGIS }) => { testClient.getLayergroup(function (err, layergroup) { assert.ifError(err); - assert.equal(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); - assert.equal(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 5); - assert.equal(layergroup.metadata.layers[1].id, mapnikBasicLayerId(1)); - assert.equal(layergroup.metadata.layers[1].meta.stats.estimatedFeatureCount, 5); + assert.strictEqual(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); + assert.strictEqual(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 5); + assert.strictEqual(layergroup.metadata.layers[1].id, mapnikBasicLayerId(1)); + assert.strictEqual(layergroup.metadata.layers[1].meta.stats.estimatedFeatureCount, 5); testClient.drain(done); }); }); @@ -234,11 +234,11 @@ suites.forEach(({ desc, usePostGIS }) => { testClient.getLayergroup(function (err, layergroup) { assert.ifError(err); - assert.equal(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); - assert.equal(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 3); + assert.strictEqual(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); + assert.strictEqual(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 3); assert.ok(!layergroup.metadata.layers[0].meta.stats[1]); - assert.equal(layergroup.metadata.layers[1].id, mapnikBasicLayerId(1)); - assert.equal(layergroup.metadata.layers[1].meta.stats.estimatedFeatureCount, 5); + assert.strictEqual(layergroup.metadata.layers[1].id, mapnikBasicLayerId(1)); + assert.strictEqual(layergroup.metadata.layers[1].meta.stats.estimatedFeatureCount, 5); assert.ok(!layergroup.metadata.layers[2]); testClient.drain(done); }); @@ -255,11 +255,11 @@ suites.forEach(({ desc, usePostGIS }) => { testClient.getLayergroup(function (err, layergroup) { assert.ifError(err); - assert.equal(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); - assert.equal(layergroup.metadata.layers[0].type, 'mapnik'); - assert.equal(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 1); - assert.equal(layergroup.metadata.layers[1].id, typeLayerId('http', 0)); - assert.equal(layergroup.metadata.layers[1].type, 'http'); + assert.strictEqual(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); + assert.strictEqual(layergroup.metadata.layers[0].type, 'mapnik'); + assert.strictEqual(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 1); + assert.strictEqual(layergroup.metadata.layers[1].id, typeLayerId('http', 0)); + assert.strictEqual(layergroup.metadata.layers[1].type, 'http'); testClient.drain(done); }); }); @@ -275,13 +275,13 @@ suites.forEach(({ desc, usePostGIS }) => { testClient.getLayergroup(function (err, layergroup) { assert.ifError(err); - assert.equal(layergroup.metadata.layers[0].id, typeLayerId('http', 0)); - assert.equal(layergroup.metadata.layers[0].type, 'http'); + assert.strictEqual(layergroup.metadata.layers[0].id, typeLayerId('http', 0)); + assert.strictEqual(layergroup.metadata.layers[0].type, 'http'); assert.ok(!layergroup.metadata.layers[0].meta.cartocss); - assert.equal(layergroup.metadata.layers[1].meta.stats.estimatedFeatureCount, 1); - assert.equal(layergroup.metadata.layers[1].id, mapnikBasicLayerId(0)); - assert.equal(layergroup.metadata.layers[1].type, 'mapnik'); - assert.equal(layergroup.metadata.layers[1].meta.cartocss, cartocss); + assert.strictEqual(layergroup.metadata.layers[1].meta.stats.estimatedFeatureCount, 1); + assert.strictEqual(layergroup.metadata.layers[1].id, mapnikBasicLayerId(0)); + assert.strictEqual(layergroup.metadata.layers[1].type, 'mapnik'); + assert.strictEqual(layergroup.metadata.layers[1].meta.cartocss, cartocss); testClient.drain(done); }); }); @@ -296,7 +296,7 @@ suites.forEach(({ desc, usePostGIS }) => { testClient.getLayergroup(function (err, layergroup) { assert.ifError(err); - assert.equal(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); + assert.strictEqual(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); // we don't care about stats here as is an aliased column assert.ok(layergroup.metadata.layers[0].meta.stats.hasOwnProperty('estimatedFeatureCount')); testClient.drain(done); @@ -316,13 +316,13 @@ suites.forEach(({ desc, usePostGIS }) => { testClient.getLayergroup(function (err, layergroup) { assert.ifError(err); - assert.equal(layergroup.metadata.layers[0].id, typeLayerId('http', 0)); - assert.equal(layergroup.metadata.layers[0].type, 'http'); - assert.equal(layergroup.metadata.layers[1].id, mapnikBasicLayerId(0)); - assert.equal(layergroup.metadata.layers[1].type, 'mapnik'); + assert.strictEqual(layergroup.metadata.layers[0].id, typeLayerId('http', 0)); + assert.strictEqual(layergroup.metadata.layers[0].type, 'http'); + assert.strictEqual(layergroup.metadata.layers[1].id, mapnikBasicLayerId(0)); + assert.strictEqual(layergroup.metadata.layers[1].type, 'mapnik'); assert.ok(!layergroup.metadata.layers[1].meta.hasOwnProperty('stats')); - assert.equal(layergroup.metadata.layers[2].id, typeLayerId('http', 1)); - assert.equal(layergroup.metadata.layers[2].type, 'http'); + assert.strictEqual(layergroup.metadata.layers[2].id, typeLayerId('http', 1)); + assert.strictEqual(layergroup.metadata.layers[2].type, 'http'); global.environment.enabledFeatures.layerStats = true; testClient.drain(done); }); @@ -346,8 +346,8 @@ suites.forEach(({ desc, usePostGIS }) => { testClient.getLayergroup(function (err, layergroup) { assert.ifError(err); - assert.equal(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); - assert.equal(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 5); + assert.strictEqual(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); + assert.strictEqual(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 5); const expectedColumns = { cartodb_id: { type: 'number' }, the_geom: { type: 'geometry' }, @@ -397,8 +397,8 @@ suites.forEach(({ desc, usePostGIS }) => { testClient.getLayergroup(function (err, layergroup) { assert.ifError(err); - assert.equal(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); - assert.equal(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 5); + assert.strictEqual(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); + assert.strictEqual(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 5); const expectedColumns = { cartodb_id: { type: 'number', @@ -455,9 +455,9 @@ suites.forEach(({ desc, usePostGIS }) => { testClient.getLayergroup(function (err, layergroup) { assert.ifError(err); - assert.equal(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); + assert.strictEqual(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); const columnsMetadata = layergroup.metadata.layers[0].meta.stats.columns; - assert.equal(columnsMetadata.address.categories.length, 2); + assert.strictEqual(columnsMetadata.address.categories.length, 2); testClient.drain(done); }); }); @@ -474,9 +474,9 @@ suites.forEach(({ desc, usePostGIS }) => { testClient.getLayergroup(function (err, layergroup) { assert.ifError(err); - assert.equal(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); + assert.strictEqual(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); const columnsMetadata = layergroup.metadata.layers[0].meta.stats.columns; - assert.equal(columnsMetadata.cat.categories.length, 3); + assert.strictEqual(columnsMetadata.cat.categories.length, 3); testClient.drain(done); }); }); @@ -493,9 +493,9 @@ suites.forEach(({ desc, usePostGIS }) => { testClient.getLayergroup(function (err, layergroup) { assert.ifError(err); - assert.equal(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); + assert.strictEqual(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); const columnsMetadata = layergroup.metadata.layers[0].meta.stats.columns; - assert.equal(columnsMetadata.cat.categories.length, 2); + assert.strictEqual(columnsMetadata.cat.categories.length, 2); testClient.drain(done); }); }); @@ -512,9 +512,9 @@ suites.forEach(({ desc, usePostGIS }) => { testClient.getLayergroup(function (err, layergroup) { assert.ifError(err); - assert.equal(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); - assert.equal(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 5); - assert.equal(layergroup.metadata.layers[0].meta.stats.featureCount, 5); + assert.strictEqual(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); + assert.strictEqual(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 5); + assert.strictEqual(layergroup.metadata.layers[0].meta.stats.featureCount, 5); testClient.drain(done); }); }); @@ -531,9 +531,9 @@ suites.forEach(({ desc, usePostGIS }) => { testClient.getLayergroup(function (err, layergroup) { assert.ifError(err); - assert.equal(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); - assert.equal(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 5); - assert.equal(layergroup.metadata.layers[0].meta.stats.geometryType, 'ST_Point'); + assert.strictEqual(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); + assert.strictEqual(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 5); + assert.strictEqual(layergroup.metadata.layers[0].meta.stats.geometryType, 'ST_Point'); testClient.drain(done); }); }); @@ -556,8 +556,8 @@ suites.forEach(({ desc, usePostGIS }) => { testClient.getLayergroup(function (err, layergroup) { assert.ifError(err); - assert.equal(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); - assert.equal(layergroup.metadata.layers[0].meta.stats.geometryType, undefined); + assert.strictEqual(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); + assert.strictEqual(layergroup.metadata.layers[0].meta.stats.geometryType, undefined); testClient.drain(done); }); }); @@ -574,8 +574,8 @@ suites.forEach(({ desc, usePostGIS }) => { testClient.getLayergroup(function (err, layergroup) { assert.ifError(err); - assert.equal(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); - assert.equal(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 100); + assert.strictEqual(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); + assert.strictEqual(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 100); assert(layergroup.metadata.layers[0].meta.stats.sample.length > 0); const expectedCols = ['cartodb_id', 'value', 'the_geom', 'the_geom_webmercator'].sort(); assert.deepEqual(Object.keys(layergroup.metadata.layers[0].meta.stats.sample[0]).sort(), expectedCols); @@ -625,8 +625,8 @@ suites.forEach(({ desc, usePostGIS }) => { testClient.getLayergroup(function (err, layergroup) { assert.ifError(err); - assert.equal(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); - assert.equal(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 100); + assert.strictEqual(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); + assert.strictEqual(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 100); assert(layergroup.metadata.layers[0].meta.stats.sample.length > 0); const expectedCols = ['cartodb_id', 'the_geom'].sort(); assert.deepEqual(Object.keys(layergroup.metadata.layers[0].meta.stats.sample[0]).sort(), expectedCols); @@ -647,12 +647,12 @@ suites.forEach(({ desc, usePostGIS }) => { testClient.getLayergroup(function (err, layergroup) { assert.ifError(err); - assert.equal(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); - assert.equal(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 5); - assert.equal(layergroup.metadata.layers[0].meta.stats.geometryType, 'ST_Point'); - assert.equal(layergroup.metadata.layers[0].meta.stats.featureCount, 5); - assert.equal(layergroup.metadata.layers[0].meta.stats.sample, undefined); - assert.equal(layergroup.metadata.layers[0].meta.stats.columns, undefined); + assert.strictEqual(layergroup.metadata.layers[0].id, mapnikBasicLayerId(0)); + assert.strictEqual(layergroup.metadata.layers[0].meta.stats.estimatedFeatureCount, 5); + assert.strictEqual(layergroup.metadata.layers[0].meta.stats.geometryType, 'ST_Point'); + assert.strictEqual(layergroup.metadata.layers[0].meta.stats.featureCount, 5); + assert.strictEqual(layergroup.metadata.layers[0].meta.stats.sample, undefined); + assert.strictEqual(layergroup.metadata.layers[0].meta.stats.columns, undefined); testClient.drain(done); }); }); diff --git a/test/acceptance/stats/multilayer-stats-test.js b/test/acceptance/stats/multilayer-stats-test.js index efa045a8..20a1a499 100644 --- a/test/acceptance/stats/multilayer-stats-test.js +++ b/test/acceptance/stats/multilayer-stats-test.js @@ -40,7 +40,7 @@ describe('multilayer stats disabled', function () { // check torque metadata at least match in number var torqueLayers = mapConfig.layers.filter(function (layer) { return layer.type === 'torque'; }); if (torqueLayers.length) { - assert.equal(Object.keys(layergroup.metadata.torque).length, torqueLayers.length); + assert.strictEqual(Object.keys(layergroup.metadata.torque).length, torqueLayers.length); } } }); diff --git a/test/acceptance/templates-test.js b/test/acceptance/templates-test.js index 07fbc282..28b37603 100644 --- a/test/acceptance/templates-test.js +++ b/test/acceptance/templates-test.js @@ -124,7 +124,7 @@ describe('template_api', function () { }, function postTemplate (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 403); + assert.strictEqual(res.statusCode, 403); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('errors'), res.body); err = parsed.errors[0]; @@ -137,7 +137,7 @@ describe('template_api', function () { }, function rePostTemplate (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsedBody = JSON.parse(res.body); var expectedBody = { template_id: expected_tpl_id }; assert.deepEqual(parsedBody, expectedBody); @@ -150,7 +150,7 @@ describe('template_api', function () { }, function checkFailure (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 400, res.body); + assert.strictEqual(res.statusCode, 400, res.body); var parsedBody = JSON.parse(res.body); assert.ok(parsedBody.hasOwnProperty('errors'), res.body); assert.ok(parsedBody.errors[0].match(/already exists/i), @@ -184,7 +184,7 @@ describe('template_api', function () { }, function checkFailure1 (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 400, res.body); + assert.strictEqual(res.statusCode, 400, res.body); var parsedBody = JSON.parse(res.body); assert.ok(parsedBody.hasOwnProperty('errors'), res.body); var re = /invalid.*authentication.*missing/i; @@ -212,7 +212,7 @@ describe('template_api', function () { }, function checkFailure2 (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 400, res.body); + assert.strictEqual(res.statusCode, 400, res.body); var parsedBody = JSON.parse(res.body); assert.ok(parsedBody.hasOwnProperty('errors'), res.body); var re = new RegExp(/invalid.*authentication.*missing/i); @@ -237,7 +237,7 @@ describe('template_api', function () { }, function putTemplateInvalid (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('template_id'), "Missing 'template_id' from response body: " + res.body); @@ -260,7 +260,7 @@ describe('template_api', function () { }, function deleteTemplate (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 400, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('errors'), "Missing 'errors' from response body: " + res.body); @@ -279,7 +279,7 @@ describe('template_api', function () { }, function checkDelete (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 204, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 204, res.statusCode + ': ' + res.body); assert.ok(!res.body, 'Unexpected body in DELETE /template response'); done(); @@ -387,7 +387,7 @@ describe('template_api', function () { }, function postTemplate2 (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('template_id'), "Missing 'template_id' from response body: " + res.body); @@ -408,7 +408,7 @@ describe('template_api', function () { }, function litsTemplatesUnauthenticated (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('template_id'), "Missing 'template_id' from response body: " + res.body); @@ -424,7 +424,7 @@ describe('template_api', function () { }, function litsTemplates (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 403, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 403, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('errors'), 'Missing error from response: ' + res.body); @@ -441,12 +441,12 @@ describe('template_api', function () { }, function checkList (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('template_ids'), "Missing 'template_ids' from response body: " + res.body); var ids = parsed.template_ids; - assert.equal(ids.length, 2); + assert.strictEqual(ids.length, 2); assert.ok(ids.indexOf(tplid1) !== -1, 'Missing "' + tplid1 + "' from list response: " + ids.join(',')); assert.ok(ids.indexOf(tplid2) !== -1, @@ -475,7 +475,7 @@ describe('template_api', function () { }, function putMisnamedTemplate (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('template_id'), "Missing 'template_id' from response body: " + res.body); @@ -495,7 +495,7 @@ describe('template_api', function () { }, function putUnexistentTemplate (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 400, res.statusCode + ': ' + res.body); var parsedBody = JSON.parse(res.body); assert.ok(parsedBody.hasOwnProperty('errors'), res.body); assert.ok(parsedBody.errors[0].match(/cannot update name/i), @@ -512,7 +512,7 @@ describe('template_api', function () { }, function putValidTemplate (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 400, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 400, res.statusCode + ': ' + res.body); var parsedBody = JSON.parse(res.body); assert.ok(parsedBody.hasOwnProperty('errors'), res.body); assert.ok(parsedBody.errors[0].match(/cannot update name/i), @@ -529,11 +529,11 @@ describe('template_api', function () { }, function checkValidUpate (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('template_id'), "Missing 'template_id' from response body: " + res.body); - assert.equal(tpl_id, parsed.template_id); + assert.strictEqual(tpl_id, parsed.template_id); keysToDelete['map_tpl|localhost'] = 0; @@ -558,7 +558,7 @@ describe('template_api', function () { }, function getTemplateUnauthorized (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('template_id'), "Missing 'template_id' from response body: " + res.body); @@ -574,7 +574,7 @@ describe('template_api', function () { }, function getTemplate (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 403, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 403, res.statusCode + ': ' + res.body); var parsedBody = JSON.parse(res.body); assert.ok(parsedBody.hasOwnProperty('errors'), res.body); assert.ok(parsedBody.errors[0].match(/only.*authenticated.*user/i), @@ -590,7 +590,7 @@ describe('template_api', function () { }, function checkReturnTemplate (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('template'), "Missing 'template' from response body: " + res.body); @@ -619,7 +619,7 @@ describe('template_api', function () { }, function getTemplate (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('template_id'), "Missing 'template_id' from response body: " + res.body); @@ -635,7 +635,7 @@ describe('template_api', function () { }, function deleteTemplateUnauthorized (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('template'), "Missing 'template' from response body: " + res.body); @@ -651,7 +651,7 @@ describe('template_api', function () { }, function deleteTemplate (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 403, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 403, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('errors'), "Missing 'errors' from response body: " + res.body); @@ -668,7 +668,7 @@ describe('template_api', function () { }, function getMissingTemplate (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 204, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 204, res.statusCode + ': ' + res.body); assert.ok(!res.body, 'Unexpected body in DELETE /template response'); var get_request = { url: '/api/v1/map/named/' + tpl_id + '?api_key=1234', @@ -681,7 +681,7 @@ describe('template_api', function () { }, function checkGetFailure (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 404, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 404, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('errors'), "Missing 'errors' from response body: " + res.body); @@ -732,7 +732,7 @@ describe('template_api', function () { }, function instanciateNoAuth (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('template_id'), "Missing 'template_id' from response body: " + res.body); @@ -750,7 +750,7 @@ describe('template_api', function () { // See https://github.com/CartoDB/Windshaft-cartodb/issues/173 function instanciateForeignDB (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 403, + assert.strictEqual(res.statusCode, 403, 'Unexpected success instanciating template with no auth: ' + res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('errors'), @@ -769,7 +769,7 @@ describe('template_api', function () { }, function instanciateAuth (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 404, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 404, res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('errors'), "Missing 'errors' from response body: " + res.body); assert.ok(parsed.errors[0].match(/not found/i), 'Unexpected error for forbidden instance : ' + parsed.errors); @@ -785,7 +785,7 @@ describe('template_api', function () { }, function fetchTileNoAuth (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, + assert.strictEqual(res.statusCode, 200, 'Instantiating template: ' + res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('layergroupid'), @@ -812,7 +812,7 @@ describe('template_api', function () { }, function fetchTileAuth (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 403, + assert.strictEqual(res.statusCode, 403, 'Fetching tile with no auth: ' + res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('errors'), @@ -831,9 +831,9 @@ describe('template_api', function () { }, function checkTile (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, + assert.strictEqual(res.statusCode, 200, 'Unexpected error for authorized instance: ' + res.statusCode + ' -- ' + res.body); - assert.equal(res.headers['content-type'], 'image/png'); + assert.strictEqual(res.headers['content-type'], 'image/png'); return null; }, // See https://github.com/CartoDB/Windshaft-cartodb/issues/172 @@ -852,7 +852,7 @@ describe('template_api', function () { }, function checkForeignSignerError (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 403, + assert.strictEqual(res.statusCode, 403, 'Unexpected error for authorized instance: ' + res.statusCode + ' -- ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('errors'), @@ -874,7 +874,7 @@ describe('template_api', function () { }, function fetchTileDeleted (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 204, + assert.strictEqual(res.statusCode, 204, 'Deleting template: ' + res.statusCode + ':' + res.body); var get_request = { url: '/api/v1/map/' + layergroupid + '/0/0/0.png?auth_token=valid1', @@ -888,8 +888,8 @@ describe('template_api', function () { }, function checkTileAvailable (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, 'Tile should be accessible'); - assert.equal(res.headers['content-type'], 'image/png'); + assert.strictEqual(res.statusCode, 200, 'Tile should be accessible'); + assert.strictEqual(res.headers['content-type'], 'image/png'); done(); } @@ -935,7 +935,7 @@ describe('template_api', function () { }, function instanciateNoAuth (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('template_id'), "Missing 'template_id' from response body: " + res.body); @@ -952,7 +952,7 @@ describe('template_api', function () { }, function instanciateAuth (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 403, + assert.strictEqual(res.statusCode, 403, 'Unexpected success instanciating template with no auth: ' + res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('errors'), @@ -971,7 +971,7 @@ describe('template_api', function () { }, function fetchTileNoAuth (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, + assert.strictEqual(res.statusCode, 200, 'Instantiating template: ' + res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('layergroupid'), @@ -998,7 +998,7 @@ describe('template_api', function () { }, function fetchTileAuth (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 403, + assert.strictEqual(res.statusCode, 403, 'Fetching tile with no auth: ' + res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('errors'), @@ -1017,13 +1017,13 @@ describe('template_api', function () { }, function checkTile_fetchOnRestart (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, + assert.strictEqual(res.statusCode, 200, 'Unexpected error for authorized instance: ' + res.statusCode + ' -- ' + res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); var cc = res.headers['x-cache-channel']; var expectedCC = 'test_windshaft_cartodb_user_1_db:public.test_table_private_1'; assert.ok(cc); - assert.equal(cc, expectedCC); + assert.strictEqual(cc, expectedCC); // hack simulating restart... // FIXME: we need a better way to reset cache while running tests server.layergroupAffectedTablesCache.cache.reset(); // need to clean channel cache @@ -1039,13 +1039,13 @@ describe('template_api', function () { }, function checkCacheChannel (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, + assert.strictEqual(res.statusCode, 200, 'Unexpected error for authorized instance: ' + res.statusCode + ' -- ' + res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); var cc = res.headers['x-cache-channel']; var expectedCC = 'test_windshaft_cartodb_user_1_db:public.test_table_private_1'; assert.ok(cc, 'Missing X-Cache-Channel on fetch-after-restart'); - assert.equal(cc, expectedCC); + assert.strictEqual(cc, expectedCC); return null; }, function deleteTemplate (err) { @@ -1061,7 +1061,7 @@ describe('template_api', function () { }, function fetchTileDeleted (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 204, + assert.strictEqual(res.statusCode, 204, 'Deleting template: ' + res.statusCode + ':' + res.body); var get_request = { url: '/api/v1/map/' + layergroupid + ':cb2/0/0/0/0.json.torque?auth_token=valid1', @@ -1075,8 +1075,8 @@ describe('template_api', function () { }, function checkTorqueTileAvailable (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, 'Torque tile should be accessible'); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.statusCode, 200, 'Torque tile should be accessible'); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); done(); } @@ -1122,7 +1122,7 @@ describe('template_api', function () { }, function instanciateNoAuth (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('template_id'), "Missing 'template_id' from response body: " + res.body); @@ -1139,7 +1139,7 @@ describe('template_api', function () { }, function instanciateAuth (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 403, + assert.strictEqual(res.statusCode, 403, 'Unexpected success instanciating template with no auth: ' + res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('errors'), @@ -1158,7 +1158,7 @@ describe('template_api', function () { }, function fetchAttributeNoAuth (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, + assert.strictEqual(res.statusCode, 200, 'Instantiating template: ' + res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('layergroupid'), @@ -1166,7 +1166,7 @@ describe('template_api', function () { layergroupid = parsed.layergroupid; assert.ok(layergroupid.match(/^localhost@/), 'Returned layergroupid does not start with signer name: ' + layergroupid); - assert.equal(res.headers['x-layergroup-id'], parsed.layergroupid); + assert.strictEqual(res.headers['x-layergroup-id'], parsed.layergroupid); assert.ok(parsed.hasOwnProperty('last_updated'), "Missing 'last_updated' from response body: " + res.body); @@ -1186,7 +1186,7 @@ describe('template_api', function () { }, function fetchAttributeAuth (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 403, + assert.strictEqual(res.statusCode, 403, 'Fetching tile with no auth: ' + res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('errors'), @@ -1205,9 +1205,9 @@ describe('template_api', function () { }, function checkAttribute (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, + assert.strictEqual(res.statusCode, 200, 'Unexpected error for authorized getAttributes: ' + res.statusCode + ' -- ' + res.body); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); return null; }, function deleteTemplate (err) { @@ -1223,7 +1223,7 @@ describe('template_api', function () { }, function fetchAttrDeleted (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 204, + assert.strictEqual(res.statusCode, 204, 'Deleting template: ' + res.statusCode + ':' + res.body); var get_request = { url: '/api/v1/map/' + layergroupid + ':cb2/0/attributes/5?auth_token=valid2', @@ -1237,8 +1237,8 @@ describe('template_api', function () { }, function checkLayerAttributesAvailable (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, 'Layer attributes should be accessible'); - assert.equal(res.headers['content-type'], 'application/json; charset=utf-8'); + assert.strictEqual(res.statusCode, 200, 'Layer attributes should be accessible'); + assert.strictEqual(res.headers['content-type'], 'application/json; charset=utf-8'); done(); } @@ -1283,7 +1283,7 @@ describe('template_api', function () { }, function instanciateNoAuth (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('template_id'), "Missing 'template_id' from response body: " + res.body); @@ -1301,7 +1301,7 @@ describe('template_api', function () { }, function instanciateAuth (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, + assert.strictEqual(res.statusCode, 200, 'Unexpected success instanciating template with no auth: ' + res.statusCode + ': ' + res.body); keysToDelete['map_cfg|' + LayergroupToken.parse(JSON.parse(res.body).layergroupid).token] = 0; @@ -1349,7 +1349,7 @@ describe('template_api', function () { }, function instanciateNoAuth (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('template_id'), "Missing 'template_id' from response body: " + res.body); @@ -1365,7 +1365,7 @@ describe('template_api', function () { }, function checkInstanciation (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); // See https://github.com/CartoDB/Windshaft-cartodb/issues/176 helper.checkCache(res); var expectedSurrogateKey = [ @@ -1434,7 +1434,7 @@ describe('template_api', function () { }, function instanciateNoAuth (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('template_id'), "Missing 'template_id' from response body: " + res.body); @@ -1450,7 +1450,7 @@ describe('template_api', function () { }, function checkInstanciation (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 200, res.statusCode + ': ' + res.body); // See https://github.com/CartoDB/Windshaft-cartodb/issues/176 helper.checkCache(res); var expectedSurrogateKey = [ @@ -1528,7 +1528,7 @@ describe('template_api', function () { }, function instantiateTemplate (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); template_id = JSON.parse(res.body).template_id; var post_request = { url: '/api/v1/map/named/' + template_id, @@ -1542,7 +1542,7 @@ describe('template_api', function () { }, function check_global_stats (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, + assert.strictEqual(res.statusCode, 200, 'Instantiating template: ' + res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('layergroupid'), @@ -1552,12 +1552,12 @@ describe('template_api', function () { }, function check_tag_stats (err, val) { assert.ifError(err); - assert.equal(val, 1, 'Expected score of ' + now + ' in ' + statskey + ':global to be 1, got ' + val); + assert.strictEqual(val, '1', 'Expected score of ' + now + ' in ' + statskey + ':global to be 1, got ' + val); redis_stats_client.ZSCORE(statskey + ':stat_tag:random_tag', now, this); }, function check_tag_stats_value (err, val) { assert.ifError(err); - assert.equal(val, 1, 'Expected score of ' + now + ' in ' + statskey + ':stat_tag:' + layergroup.stat_tag + + assert.equal(val, '1', 'Expected score of ' + now + ' in ' + statskey + ':stat_tag:' + layergroup.stat_tag + ' to be 1, got ' + val); return null; }, @@ -1576,7 +1576,7 @@ describe('template_api', function () { if (err) { return done(err); } - assert.equal(res.statusCode, 204, res.statusCode + ': ' + res.body); + assert.strictEqual(res.statusCode, 204, res.statusCode + ': ' + res.body); if (err) { errors.push('' + err); } @@ -1628,7 +1628,7 @@ describe('template_api', function () { }, function instance1 (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('template_id'), "Missing 'template_id' from response body: " + res.body); @@ -1645,7 +1645,7 @@ describe('template_api', function () { }, function checkInstance1 (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, + assert.strictEqual(res.statusCode, 200, 'Instantiating template: ' + res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('layergroupid'), @@ -1673,11 +1673,11 @@ describe('template_api', function () { }, function instance2 (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, res.body); + assert.strictEqual(res.statusCode, 200, res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('template_id'), "Missing 'template_id' from response body: " + res.body); - assert.equal(tpl_id, parsed.template_id); + assert.strictEqual(tpl_id, parsed.template_id); var post_request = { url: '/api/v1/map/named/' + tpl_id + '?auth_token=valid2', method: 'POST', @@ -1690,7 +1690,7 @@ describe('template_api', function () { }, function checkInstance2 (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200, + assert.strictEqual(res.statusCode, 200, 'Instantiating template: ' + res.statusCode + ': ' + res.body); var parsed = JSON.parse(res.body); assert.ok(parsed.hasOwnProperty('layergroupid'), @@ -1828,7 +1828,7 @@ describe('template_api', function () { if (err) { throw err; } - assert.equal(res.headers['content-type'], 'image/png'); + assert.strictEqual(res.headers['content-type'], 'image/png'); return null; }, function deleteTemplate (err) { diff --git a/test/acceptance/tilejson-test.js b/test/acceptance/tilejson-test.js index 1527cc98..6e8c53c4 100644 --- a/test/acceptance/tilejson-test.js +++ b/test/acceptance/tilejson-test.js @@ -21,7 +21,7 @@ function tileJsonSuite (usePostGIS) { }); function tilejsonValidation (tilejson, shouldHaveGrid = false) { - assert.equal(tilejson.tilejson, '2.2.0'); + assert.strictEqual(tilejson.tilejson, '2.2.0'); assert.ok(Array.isArray(tilejson.tiles), JSON.stringify(tilejson)); assert.ok(tilejson.tiles.length > 0); @@ -77,7 +77,7 @@ function tileJsonSuite (usePostGIS) { const metadata = layergroupResult.metadata; assert.ok(metadata); - assert.equal(metadata.layers.length, 1); + assert.strictEqual(metadata.layers.length, 1); const layer = metadata.layers[0]; assert.deepEqual(Object.keys(layer.tilejson), ['vector', 'raster']); @@ -98,7 +98,7 @@ function tileJsonSuite (usePostGIS) { const metadata = layergroupResult.metadata; assert.ok(metadata); - assert.equal(metadata.layers.length, 1); + assert.strictEqual(metadata.layers.length, 1); const layer = metadata.layers[0]; assert.deepEqual(Object.keys(layer.tilejson), ['vector']); @@ -119,7 +119,7 @@ function tileJsonSuite (usePostGIS) { const metadata = layergroupResult.metadata; assert.ok(metadata); - assert.equal(metadata.layers.length, 1); + assert.strictEqual(metadata.layers.length, 1); const layer = metadata.layers[0]; assert.deepEqual(Object.keys(layer.tilejson), ['raster']); @@ -140,7 +140,7 @@ function tileJsonSuite (usePostGIS) { const metadata = layergroupResult.metadata; assert.ok(metadata); - assert.equal(metadata.layers.length, 1); + assert.strictEqual(metadata.layers.length, 1); const layer = metadata.layers[0]; assert.deepEqual(Object.keys(layer.tilejson), ['vector', 'raster']); @@ -160,7 +160,7 @@ function tileJsonSuite (usePostGIS) { const metadata = layergroupResult.metadata; assert.ok(metadata); - assert.equal(metadata.layers.length, 2); + assert.strictEqual(metadata.layers.length, 2); assert.deepEqual(Object.keys(metadata.layers[0].tilejson), ['vector', 'raster']); tilejsonValidation(metadata.layers[0].tilejson.vector); diff --git a/test/acceptance/turbo-carto/error-cases-test.js b/test/acceptance/turbo-carto/error-cases-test.js index 69d0a5ec..3e167832 100644 --- a/test/acceptance/turbo-carto/error-cases-test.js +++ b/test/acceptance/turbo-carto/error-cases-test.js @@ -57,7 +57,7 @@ describe('turbo-carto error cases', function () { assert.ok(!err, err); assert.ok(layergroup.hasOwnProperty('errors')); - assert.equal(layergroup.errors.length, 1); + assert.strictEqual(layergroup.errors.length, 1); assert.ok(layergroup.errors[0].match(/^Failed\sto\sprocess/), layergroup.errors[0]); assert.ok(layergroup.errors[0].match(/invalid\sramp\slength/i), layergroup.errors[0]); @@ -71,7 +71,7 @@ describe('turbo-carto error cases', function () { assert.ok(!err, err); assert.ok(layergroup.hasOwnProperty('errors')); - assert.equal(layergroup.errors.length, 1); + assert.strictEqual(layergroup.errors.length, 1); assert.ok(layergroup.errors[0].match(/^Failed\sto\sprocess/)); assert.ok(layergroup.errors[0].match(/unable\sto\scompute\sramp/i)); assert.ok(layergroup.errors[0].match(/wadus_column/)); @@ -86,7 +86,7 @@ describe('turbo-carto error cases', function () { assert.ok(!err, err); assert.ok(layergroup.hasOwnProperty('errors')); - assert.equal(layergroup.errors.length, 1); + assert.strictEqual(layergroup.errors.length, 1); assert.ok(layergroup.errors[0].match(/^Failed\sto\sprocess/)); assert.ok(layergroup.errors[0].match(/unable\sto\scompute\sramp/i)); assert.ok(layergroup.errors[0].match(/invalid\smethod\s\"wadusmethod\"/i)); @@ -101,7 +101,7 @@ describe('turbo-carto error cases', function () { assert.ok(!err, err); assert.ok(layergroup.hasOwnProperty('errors')); - assert.equal(layergroup.errors.length, 1); + assert.strictEqual(layergroup.errors.length, 1); assert.ok(!layergroup.errors[0].match(/^Failed\sto\sprocess/)); assert.ok(layergroup.errors[0].match(/invalid\scode/i)); @@ -115,18 +115,18 @@ describe('turbo-carto error cases', function () { assert.ok(!err, err); assert.ok(layergroup.hasOwnProperty('errors')); - assert.equal(layergroup.errors_with_context.length, 1); - assert.equal(layergroup.errors_with_context[0].type, 'layer'); - assert.equal(layergroup.errors_with_context[0].subtype, 'turbo-carto'); + assert.strictEqual(layergroup.errors_with_context.length, 1); + assert.strictEqual(layergroup.errors_with_context[0].type, 'layer'); + assert.strictEqual(layergroup.errors_with_context[0].subtype, 'turbo-carto'); assert.ok(layergroup.errors_with_context[0].message.match(/^Failed\sto\sprocess/)); assert.ok(layergroup.errors_with_context[0].message.match(/unable\sto\scompute\sramp/i)); assert.ok(layergroup.errors_with_context[0].message.match(/wadus_column/)); - assert.equal(layergroup.errors_with_context[0].layer.id, 'layer0'); - assert.equal(layergroup.errors_with_context[0].layer.index, 0); - assert.equal(layergroup.errors_with_context[0].layer.type, 'mapnik'); + assert.strictEqual(layergroup.errors_with_context[0].layer.id, 'layer0'); + assert.strictEqual(layergroup.errors_with_context[0].layer.index, 0); + assert.strictEqual(layergroup.errors_with_context[0].layer.type, 'mapnik'); - assert.equal(layergroup.errors_with_context[0].layer.context.selector, '#populated_places_simple_reduced'); + assert.strictEqual(layergroup.errors_with_context[0].layer.context.selector, '#populated_places_simple_reduced'); assert.deepEqual(layergroup.errors_with_context[0].layer.context.source, { start: { line: 10, @@ -169,21 +169,21 @@ describe('turbo-carto error cases', function () { assert.ok(!err, err); assert.ok(layergroup.hasOwnProperty('errors')); - assert.equal(layergroup.errors_with_context.length, 2); + assert.strictEqual(layergroup.errors_with_context.length, 2); - assert.equal(layergroup.errors_with_context[0].type, 'layer'); - assert.equal(layergroup.errors_with_context[0].subtype, 'turbo-carto'); + assert.strictEqual(layergroup.errors_with_context[0].type, 'layer'); + assert.strictEqual(layergroup.errors_with_context[0].subtype, 'turbo-carto'); assert.ok(layergroup.errors_with_context[0].message.match(/^Failed\sto\sprocess/)); assert.ok(layergroup.errors_with_context[0].message.match(/unable\sto\scompute\sramp/i)); assert.ok(layergroup.errors_with_context[0].message.match(/wadus_column/)); - assert.equal(layergroup.errors_with_context[0].layer.id, 'layer0'); + assert.strictEqual(layergroup.errors_with_context[0].layer.id, 'layer0'); - assert.equal(layergroup.errors_with_context[1].type, 'layer'); - assert.equal(layergroup.errors_with_context[1].subtype, 'turbo-carto'); + assert.strictEqual(layergroup.errors_with_context[1].type, 'layer'); + assert.strictEqual(layergroup.errors_with_context[1].subtype, 'turbo-carto'); assert.ok(layergroup.errors_with_context[1].message.match(/^Failed\sto\sprocess/)); assert.ok(layergroup.errors_with_context[1].message.match(/unable\sto\scompute\sramp/i)); assert.ok(layergroup.errors_with_context[1].message.match(/invalid_column/)); - assert.equal(layergroup.errors_with_context[1].layer.id, 'layer1'); + assert.strictEqual(layergroup.errors_with_context[1].layer.id, 'layer1'); done(); }); diff --git a/test/acceptance/turbo-carto/named-maps-test.js b/test/acceptance/turbo-carto/named-maps-test.js index 7d009d7b..cfb81535 100644 --- a/test/acceptance/turbo-carto/named-maps-test.js +++ b/test/acceptance/turbo-carto/named-maps-test.js @@ -103,7 +103,7 @@ describe('turbo-carto for named maps', function () { }, function checkTemplate (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200); + assert.strictEqual(res.statusCode, 200); assert.deepEqual(JSON.parse(res.body), { template_id: templateId }); @@ -130,7 +130,7 @@ describe('turbo-carto for named maps', function () { function checkInstanciationWithReds (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200); + assert.strictEqual(res.statusCode, 200); var parsedBody = JSON.parse(res.body); @@ -162,8 +162,8 @@ describe('turbo-carto for named maps', function () { var next = this; - assert.equal(res.statusCode, 200); - assert.equal(res.headers['content-type'], 'image/png'); + assert.strictEqual(res.statusCode, 200); + assert.strictEqual(res.headers['content-type'], 'image/png'); var fixturePath = './test/fixtures/turbo-carto-named-maps-reds.png'; var image = mapnik.Image.fromBytes(new Buffer(res.body, 'binary')); @@ -189,7 +189,7 @@ describe('turbo-carto for named maps', function () { }, function checkInstanciationWithBlues (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 200); + assert.strictEqual(res.statusCode, 200); var parsedBody = JSON.parse(res.body); @@ -221,8 +221,8 @@ describe('turbo-carto for named maps', function () { var next = this; - assert.equal(res.statusCode, 200); - assert.equal(res.headers['content-type'], 'image/png'); + assert.strictEqual(res.statusCode, 200); + assert.strictEqual(res.headers['content-type'], 'image/png'); var fixturePath = './test/fixtures/turbo-carto-named-maps-blues.png'; var image = mapnik.Image.fromBytes(new Buffer(res.body, 'binary')); @@ -244,7 +244,7 @@ describe('turbo-carto for named maps', function () { }, function checkDeleteTemplate (err, res) { assert.ifError(err); - assert.equal(res.statusCode, 204); + assert.strictEqual(res.statusCode, 204); assert.ok(!res.body); return null; diff --git a/test/acceptance/turbo-carto/regressions-test.js b/test/acceptance/turbo-carto/regressions-test.js index 666df0a7..83bdf7b6 100644 --- a/test/acceptance/turbo-carto/regressions-test.js +++ b/test/acceptance/turbo-carto/regressions-test.js @@ -88,7 +88,7 @@ describe('turbo-carto regressions', function () { var turboCartoError = layergroup.errors_with_context[0]; assert.ok(turboCartoError); - assert.equal(turboCartoError.type, 'layer'); + assert.strictEqual(turboCartoError.type, 'layer'); assert.ok(turboCartoError.message.match(/permission\sdenied\sfor\s.+?test_table_private_1/)); done(); @@ -464,7 +464,7 @@ describe('turbo-carto regressions', function () { const rule = layergroup.metadata.layers[0].meta.cartocss_meta.rules[0]; assert.ok(!err, err); - assert.equal(rule.buckets.length, scenario.numBuckets); + assert.strictEqual(rule.buckets.length, scenario.numBuckets); assert.deepEqual(rule.buckets, scenario.bucketResponse); done(); diff --git a/test/acceptance/user-database-timeout-limit-test.js b/test/acceptance/user-database-timeout-limit-test.js index ac057a4b..d10eda09 100644 --- a/test/acceptance/user-database-timeout-limit-test.js +++ b/test/acceptance/user-database-timeout-limit-test.js @@ -459,10 +459,10 @@ describe('user database timeout limit', function () { assert.ifError(err); var tileJSON = tile.toJSON(); - assert.equal(Array.isArray(tileJSON), true); - assert.equal(tileJSON.length, 2); - assert.equal(tileJSON[0].name, 'errorTileSquareLayer'); - assert.equal(tileJSON[1].name, 'errorTileStripesLayer'); + assert.strictEqual(Array.isArray(tileJSON), true); + assert.strictEqual(tileJSON.length, 2); + assert.strictEqual(tileJSON[0].name, 'errorTileSquareLayer'); + assert.strictEqual(tileJSON[1].name, 'errorTileStripesLayer'); done(); }); diff --git a/test/acceptance/user-render-timeout-limit-test.js b/test/acceptance/user-render-timeout-limit-test.js index bb62d682..30390c52 100644 --- a/test/acceptance/user-render-timeout-limit-test.js +++ b/test/acceptance/user-render-timeout-limit-test.js @@ -269,10 +269,10 @@ describe('user render timeout limit', function () { assert.ifError(err); var tileJSON = tile.toJSON(); - assert.equal(Array.isArray(tileJSON), true); - assert.equal(tileJSON.length, 2); - assert.equal(tileJSON[0].name, 'errorTileSquareLayer'); - assert.equal(tileJSON[1].name, 'errorTileStripesLayer'); + assert.strictEqual(Array.isArray(tileJSON), true); + assert.strictEqual(tileJSON.length, 2); + assert.strictEqual(tileJSON[0].name, 'errorTileSquareLayer'); + assert.strictEqual(tileJSON[1].name, 'errorTileStripesLayer'); done(); }); diff --git a/test/acceptance/vector-layergroup-test.js b/test/acceptance/vector-layergroup-test.js index cf9f43df..350773a3 100644 --- a/test/acceptance/vector-layergroup-test.js +++ b/test/acceptance/vector-layergroup-test.js @@ -109,22 +109,22 @@ suites.forEach((suite) => { return done(err); } - assert.equal(tile.tileSize, 4096); - assert.equal(tile.z, 0); - assert.equal(tile.x, 0); - assert.equal(tile.y, 0); + assert.strictEqual(tile.tileSize, 4096); + assert.strictEqual(tile.z, 0); + assert.strictEqual(tile.x, 0); + assert.strictEqual(tile.y, 0); const layer0 = JSON.parse(tile.toGeoJSONSync(0)); - assert.equal(layer0.name, 'layer0'); - assert.equal(layer0.features[0].type, 'Feature'); - assert.equal(layer0.features[0].geometry.type, 'Point'); + assert.strictEqual(layer0.name, 'layer0'); + assert.strictEqual(layer0.features[0].type, 'Feature'); + assert.strictEqual(layer0.features[0].geometry.type, 'Point'); const layer1 = JSON.parse(tile.toGeoJSONSync(1)); - assert.equal(layer1.name, 'layer1'); - assert.equal(layer1.features[0].type, 'Feature'); - assert.equal(layer1.features[0].geometry.type, 'Point'); + assert.strictEqual(layer1.name, 'layer1'); + assert.strictEqual(layer1.features[0].type, 'Feature'); + assert.strictEqual(layer1.features[0].geometry.type, 'Point'); done(); }); }); @@ -135,16 +135,16 @@ suites.forEach((suite) => { return done(err); } - assert.equal(tile.tileSize, 4096); - assert.equal(tile.z, 0); - assert.equal(tile.x, 0); - assert.equal(tile.y, 0); + assert.strictEqual(tile.tileSize, 4096); + assert.strictEqual(tile.z, 0); + assert.strictEqual(tile.x, 0); + assert.strictEqual(tile.y, 0); const layer = JSON.parse(tile.toGeoJSONSync(0)); - assert.equal(layer.name, 'layer0'); - assert.equal(layer.features[0].type, 'Feature'); - assert.equal(layer.features[0].geometry.type, 'Point'); + assert.strictEqual(layer.name, 'layer0'); + assert.strictEqual(layer.features[0].type, 'Feature'); + assert.strictEqual(layer.features[0].geometry.type, 'Point'); done(); }); @@ -156,16 +156,16 @@ suites.forEach((suite) => { return done(err); } - assert.equal(tile.tileSize, 4096); - assert.equal(tile.z, 0); - assert.equal(tile.x, 0); - assert.equal(tile.y, 0); + assert.strictEqual(tile.tileSize, 4096); + assert.strictEqual(tile.z, 0); + assert.strictEqual(tile.x, 0); + assert.strictEqual(tile.y, 0); const layer = JSON.parse(tile.toGeoJSONSync(0)); - assert.equal(layer.name, 'layer1'); - assert.equal(layer.features[0].type, 'Feature'); - assert.equal(layer.features[0].geometry.type, 'Point'); + assert.strictEqual(layer.name, 'layer1'); + assert.strictEqual(layer.features[0].type, 'Feature'); + assert.strictEqual(layer.features[0].geometry.type, 'Point'); done(); }); diff --git a/test/acceptance/widgets/aggregation-test.js b/test/acceptance/widgets/aggregation-test.js index 69880801..3707a133 100644 --- a/test/acceptance/widgets/aggregation-test.js +++ b/test/acceptance/widgets/aggregation-test.js @@ -37,7 +37,7 @@ describe('aggregation widgets', function () { } var aggregation = JSON.parse(res.body); - assert.equal(aggregation.categories.length, 6); + assert.strictEqual(aggregation.categories.length, 6); assert.deepEqual(aggregation.categories[0], { value: 769, category: 'USA', agg: false }); testClient.drain(done); @@ -61,7 +61,7 @@ describe('aggregation widgets', function () { } var aggregation = JSON.parse(res.body); - assert.equal(aggregation.categories.length, 1); + assert.strictEqual(aggregation.categories.length, 1); assert.deepEqual(aggregation.categories[0], { value: 256, category: 'CAN', agg: false }); testClient.drain(done); diff --git a/test/acceptance/widgets/named-maps-test.js b/test/acceptance/widgets/named-maps-test.js index 5c577ab8..1b79432a 100644 --- a/test/acceptance/widgets/named-maps-test.js +++ b/test/acceptance/widgets/named-maps-test.js @@ -223,7 +223,7 @@ describe('named-maps widgets', function () { }); widgetsQueue.awaitAll(function (err, results) { - assert.equal(results.length, 3); + assert.strictEqual(results.length, 3); done(err); }); }); @@ -232,8 +232,8 @@ describe('named-maps widgets', function () { getWidget('country_places_count', function (err, response, aggregation) { assert.ok(!err, err); - assert.equal(aggregation.type, 'aggregation'); - assert.equal(aggregation.max, 769); + assert.strictEqual(aggregation.type, 'aggregation'); + assert.strictEqual(aggregation.max, 769); return done(); }); @@ -243,8 +243,8 @@ describe('named-maps widgets', function () { getWidget('pop_max', function (err, response, histogram) { assert.ok(!err, err); - assert.equal(histogram.type, 'histogram'); - assert.equal(histogram.bin_width, 743250); + assert.strictEqual(histogram.type, 'histogram'); + assert.strictEqual(histogram.bin_width, 743250); return done(); }); diff --git a/test/acceptance/widgets/ported/aggregation-test.js b/test/acceptance/widgets/ported/aggregation-test.js index e851587f..65aa44c9 100644 --- a/test/acceptance/widgets/ported/aggregation-test.js +++ b/test/acceptance/widgets/ported/aggregation-test.js @@ -43,9 +43,9 @@ describe('widgets', function () { this.testClient.getWidget('adm0name', { own_filter: 0 }, function (err, res, aggregation) { assert.ok(!err, err); assert.ok(aggregation); - assert.equal(aggregation.type, 'aggregation'); + assert.strictEqual(aggregation.type, 'aggregation'); - assert.equal(aggregation.categories.length, 6); + assert.strictEqual(aggregation.categories.length, 6); assert.deepEqual( aggregation.categories[0], @@ -91,9 +91,9 @@ describe('widgets', function () { this.testClient.getWidget('adm0name', params, function (err, res, aggregation) { assert.ok(!err, err); assert.ok(aggregation); - assert.equal(aggregation.type, 'aggregation'); + assert.strictEqual(aggregation.type, 'aggregation'); - assert.equal(aggregation.categories.length, scenario.accept.length); + assert.strictEqual(aggregation.categories.length, scenario.accept.length); var categoriesByCategory = aggregation.categories.reduce(function (byCategory, row) { byCategory[row.category] = row; @@ -143,9 +143,9 @@ describe('widgets', function () { this.testClient.getWidget('adm0name', { own_filter: 0 }, function (err, res, aggregation) { assert.ok(!err, err); assert.ok(aggregation); - assert.equal(aggregation.type, 'aggregation'); + assert.strictEqual(aggregation.type, 'aggregation'); - assert.equal(aggregation.categories.length, 6); + assert.strictEqual(aggregation.categories.length, 6); assert.deepEqual( aggregation.categories[0], @@ -190,9 +190,9 @@ describe('widgets', function () { this.testClient.getWidget('adm0name', params, function (err, res, aggregation) { assert.ok(!err, err); assert.ok(aggregation); - assert.equal(aggregation.type, 'aggregation'); + assert.strictEqual(aggregation.type, 'aggregation'); - assert.equal(aggregation.categories.length, scenario.accept.length); + assert.strictEqual(aggregation.categories.length, scenario.accept.length); var categoriesByCategory = aggregation.categories.reduce(function (byCategory, row) { byCategory[row.category] = row; @@ -253,9 +253,9 @@ describe('widgets', function () { this.testClient.getWidget('scalerank', params, function (err, res, aggregation) { assert.ok(!err, err); assert.ok(aggregation); - assert.equal(aggregation.type, 'aggregation'); + assert.strictEqual(aggregation.type, 'aggregation'); - assert.equal(aggregation.categories.length, 1); + assert.strictEqual(aggregation.categories.length, 1); assert.deepEqual(aggregation.categories[0], { category: '1', value: 179, agg: false }); done(); @@ -289,9 +289,9 @@ describe('widgets', function () { this.testClient.widgetSearch('scalerank', userQuery, params, function (err, res, searchResult) { assert.ok(!err, err); assert.ok(searchResult); - assert.equal(searchResult.type, 'aggregation'); + assert.strictEqual(searchResult.type, 'aggregation'); - assert.equal(searchResult.categories.length, 2); + assert.strictEqual(searchResult.categories.length, 2); assert.deepEqual( searchResult.categories, [{ category: 10, value: 515 }, { category: 1, value: 179 }] @@ -309,9 +309,9 @@ describe('widgets', function () { this.testClient.widgetSearch('adm0name', userQuery, function (err, res, searchResult) { assert.ok(!err, err); assert.ok(searchResult); - assert.equal(searchResult.type, 'aggregation'); + assert.strictEqual(searchResult.type, 'aggregation'); - assert.equal(searchResult.categories.length, 1); + assert.strictEqual(searchResult.categories.length, 1); assert.deepEqual( searchResult.categories, [{ category: 'Argentina', value: 159 }] @@ -328,9 +328,9 @@ describe('widgets', function () { this.testClient.widgetSearch('adm0name', userQuery, function (err, res, searchResult) { assert.ok(!err, err); assert.ok(searchResult); - assert.equal(searchResult.type, 'aggregation'); + assert.strictEqual(searchResult.type, 'aggregation'); - assert.equal(searchResult.categories.length, 1); + assert.strictEqual(searchResult.categories.length, 1); assert.deepEqual( searchResult.categories, [{ category: 'Argentina', value: 28015640 }] diff --git a/test/acceptance/widgets/ported/formula-test.js b/test/acceptance/widgets/ported/formula-test.js index 818f9725..6499314f 100644 --- a/test/acceptance/widgets/ported/formula-test.js +++ b/test/acceptance/widgets/ported/formula-test.js @@ -54,9 +54,9 @@ describe('widgets', function () { this.testClient = new TestClient(widgetsMapConfig(widgets)); this.testClient.getWidget('pop_max_f', function (err, res, result) { assert.ok(!err, err); - assert.equal(result.operation, operation); - assert.equal(result.result, operations[operation][0]); - assert.equal(result.nulls, operations[operation][1]); + assert.strictEqual(result.operation, operation); + assert.strictEqual(result.result, operations[operation][0]); + assert.strictEqual(result.nulls, operations[operation][1]); done(); }); @@ -76,9 +76,9 @@ describe('widgets', function () { this.testClient = new TestClient(widgetsMapConfig(widgets)); this.testClient.getWidget('pop_max_count_f', function (err, res, result) { assert.ok(!err, err); - assert.equal(result.operation, operation); - assert.equal(result.result, operations[operation][0]); - assert.equal(result.nulls, operations[operation][1]); + assert.strictEqual(result.operation, operation); + assert.strictEqual(result.result, operations[operation][0]); + assert.strictEqual(result.nulls, operations[operation][1]); done(); }); diff --git a/test/acceptance/widgets/ported/histogram-test.js b/test/acceptance/widgets/ported/histogram-test.js index b7f0929d..6dc8cefc 100644 --- a/test/acceptance/widgets/ported/histogram-test.js +++ b/test/acceptance/widgets/ported/histogram-test.js @@ -50,7 +50,7 @@ describe('widgets', function () { this.testClient.getWidget('scalerank', function (err, res, histogram) { assert.ok(!err, err); assert.ok(histogram); - assert.equal(histogram.type, 'histogram'); + assert.strictEqual(histogram.type, 'histogram'); validateHistogramBins(histogram); assert.ok(histogram.bins.length); @@ -66,7 +66,7 @@ describe('widgets', function () { this.testClient.getWidget('pop_max', function (err, res, histogram) { assert.ok(!err, err); assert.ok(histogram); - assert.equal(histogram.type, 'histogram'); + assert.strictEqual(histogram.type, 'histogram'); validateHistogramBins(histogram); assert.ok(histogram.bins.length); @@ -97,7 +97,7 @@ describe('widgets', function () { this.testClient.getWidget('pop_max', params, function (err, res, histogram) { assert.ok(!err, err); assert.ok(histogram); - assert.equal(histogram.type, 'histogram'); + assert.strictEqual(histogram.type, 'histogram'); validateHistogramBins(histogram); assert.ok(histogram.bins.length); @@ -137,7 +137,7 @@ describe('widgets', function () { this.testClient = new TestClient(histogram20binsMapConfig); this.testClient.getWidget('pop_max', { start: 0, end: 35676000, bins: 20 }, function (err, res, histogram) { assert.ok(!err, err); - assert.equal(histogram.type, 'histogram'); + assert.strictEqual(histogram.type, 'histogram'); validateHistogramBins(histogram); assert.ok(histogram.bins.length); assert.deepEqual( @@ -165,9 +165,9 @@ describe('widgets', function () { this.testClient = new TestClient(fixedBinsHistogramMapConfig); this.testClient.getWidget('pop_max', { bins: 5 }, function (err, res, histogram) { assert.ok(!err, err); - assert.equal(histogram.type, 'histogram'); + assert.strictEqual(histogram.type, 'histogram'); - assert.equal(histogram.bins_count, 5); + assert.strictEqual(histogram.bins_count, 5); validateHistogramBins(histogram); @@ -191,7 +191,7 @@ describe('widgets', function () { var end = start + (histogram.bins_count * binWidth); var firstBin = histogram.bins[0]; - assert.equal(firstBin.min, start, + assert.strictEqual(firstBin.min, start, 'First bin does not match min and start ' + JSON.stringify({ min: firstBin.min, start: start @@ -199,7 +199,7 @@ describe('widgets', function () { ); var lastBin = histogram.bins[histogram.bins.length - 1]; - assert.equal(lastBin.max, end, + assert.strictEqual(lastBin.max, end, 'Last bin does not match max and end ' + JSON.stringify({ max: lastBin.max, end: end @@ -270,7 +270,7 @@ describe('widgets', function () { this.testClient.getWidget('updated_at', function (err, res, histogram) { assert.ok(!err, err); assert.ok(histogram); - assert.equal(histogram.type, 'histogram'); + assert.strictEqual(histogram.type, 'histogram'); assert.ok(histogram.bins.length); @@ -296,7 +296,7 @@ describe('widgets', function () { this.testClient.getWidget('updated_at', params, function (err, res, histogram) { assert.ok(!err, err); assert.ok(histogram); - assert.equal(histogram.type, 'histogram'); + assert.strictEqual(histogram.type, 'histogram'); assert.ok(histogram.bins.length); @@ -327,9 +327,9 @@ describe('widgets', function () { this.testClient.getWidget('updated_at', params, function (err, res, histogram) { assert.ok(!err, err); assert.ok(histogram); - assert.equal(histogram.type, 'histogram'); + assert.strictEqual(histogram.type, 'histogram'); - assert.equal(histogram.bins.length, 0); + assert.strictEqual(histogram.bins.length, 0); done(); }); @@ -390,7 +390,7 @@ describe('widgets', function () { this.testClient.getWidget('updated_at', params, function (err, res, histogram) { assert.ok(!err, err); assert.ok(histogram); - assert.equal(histogram.type, 'histogram'); + assert.strictEqual(histogram.type, 'histogram'); assert.ok(histogram.bins.length); diff --git a/test/acceptance/widgets/regressions-test.js b/test/acceptance/widgets/regressions-test.js index bd652b94..1233c9e0 100644 --- a/test/acceptance/widgets/regressions-test.js +++ b/test/acceptance/widgets/regressions-test.js @@ -52,9 +52,9 @@ describe('widgets-regressions', function () { this.testClient.getWidget('adm0name', { own_filter: 0 }, function (err, res, aggregation) { assert.ok(!err, err); assert.ok(aggregation); - assert.equal(aggregation.type, 'aggregation'); + assert.strictEqual(aggregation.type, 'aggregation'); - assert.equal(aggregation.categories.length, 6); + assert.strictEqual(aggregation.categories.length, 6); assert.deepEqual( aggregation.categories[0], @@ -151,9 +151,9 @@ describe('widgets-regressions', function () { assert.ok(!err, err); assert.ok(layergroup.metadata); var metadata = layergroup.metadata; - assert.equal(metadata.layers.length, 3); - assert.equal(metadata.analyses.length, 2); - assert.equal(Object.keys(metadata.dataviews).length, 4); + assert.strictEqual(metadata.layers.length, 3); + assert.strictEqual(metadata.analyses.length, 2); + assert.strictEqual(Object.keys(metadata.dataviews).length, 4); assert.deepEqual( Object.keys(metadata.dataviews), ['wadus', 'adm0name_categories', 'adm1name_categories', 'pop_max_histogram'] @@ -199,9 +199,9 @@ describe('widgets-regressions', function () { this.testClient.getWidget('adm0name', { own_filter: 0 }, function (err, res, aggregation) { assert.ok(!err, err); assert.ok(aggregation); - assert.equal(aggregation.type, 'aggregation'); + assert.strictEqual(aggregation.type, 'aggregation'); - assert.equal(aggregation.categories.length, 6); + assert.strictEqual(aggregation.categories.length, 6); assert.deepEqual( aggregation.categories[0], @@ -317,8 +317,8 @@ describe('widgets-regressions', function () { }; this.testClient.getDataview('val_formula', params, function (err, dataview) { assert.ifError(err); - assert.equal(dataview.categories.length, 1); - assert.equal(dataview.categories[0].category, 'intersectingTriangle'); + assert.strictEqual(dataview.categories.length, 1); + assert.strictEqual(dataview.categories[0].category, 'intersectingTriangle'); done(); }); }); diff --git a/test/acceptance/widgets/widgets-test.js b/test/acceptance/widgets/widgets-test.js index 16b9b957..59d16ada 100644 --- a/test/acceptance/widgets/widgets-test.js +++ b/test/acceptance/widgets/widgets-test.js @@ -58,7 +58,7 @@ describe('widget filters', function () { assert.deepEqual(aggregation.categories[0], { value: 769, category: 'USA', agg: false }); // confirm 'CHN' was filtered out (reject) - assert.equal(aggregation.categories.reduce(function (sum, row) { + assert.strictEqual(aggregation.categories.reduce(function (sum, row) { return sum + (row.category === 'CHN' ? 1 : 0); }, 0), 0); @@ -89,7 +89,7 @@ describe('widget filters', function () { assert.deepEqual(aggregation.categories[0], { value: 4, category: 'IND', agg: false }); // confirm 'CHN' was filtered out (reject) - assert.equal(aggregation.categories.reduce(function (sum, row) { + assert.strictEqual(aggregation.categories.reduce(function (sum, row) { return sum + (row.category === 'CHN' ? 1 : 0); }, 0), 0); @@ -120,7 +120,7 @@ describe('widget filters', function () { assert.deepEqual(aggregation.categories[0], { value: 96, category: 'RUS', agg: false }); // confirm 'CHN' was filtered out (reject) - assert.equal(aggregation.categories.reduce(function (sum, row) { + assert.strictEqual(aggregation.categories.reduce(function (sum, row) { return sum + (row.category === 'CHN' ? 1 : 0); }, 0), 0); @@ -152,7 +152,7 @@ describe('widget filters', function () { assert.deepEqual(aggregation.categories[0], { value: 77, category: 'TUR', agg: false }); // confirm 'CHN' was filtered out (reject) - assert.equal(aggregation.categories.reduce(function (sum, row) { + assert.strictEqual(aggregation.categories.reduce(function (sum, row) { return sum + (row.category === 'CHN' ? 1 : 0); }, 0), 0); diff --git a/test/integration/analysis-backend-limits-test.js b/test/integration/analysis-backend-limits-test.js index 057919d1..233507fe 100644 --- a/test/integration/analysis-backend-limits-test.js +++ b/test/integration/analysis-backend-limits-test.js @@ -55,10 +55,10 @@ describe('analysis-backend limits', function () { assert.ok(!err, err); assert.ok(result.analyses.moran); - assert.equal(result.analyses.moran.timeout, 5000); + assert.strictEqual(result.analyses.moran.timeout, 5000); assert.ok(result.analyses.kmeans); - assert.equal(result.analyses.kmeans.timeout, 5000); + assert.strictEqual(result.analyses.kmeans.timeout, 5000); done(); }); @@ -78,7 +78,7 @@ describe('analysis-backend limits', function () { assert.ok(!err, err); assert.ok(result.analyses.moran); - assert.equal(result.analyses.moran.timeout, 5000); + assert.strictEqual(result.analyses.moran.timeout, 5000); done(); }); @@ -103,7 +103,7 @@ describe('analysis-backend limits', function () { assert.ok(!err, err); assert.ok(result.analyses.moran); - assert.equal(result.analyses.moran.timeout, 5000); + assert.strictEqual(result.analyses.moran.timeout, 5000); done(); }); @@ -129,10 +129,10 @@ describe('analysis-backend limits', function () { assert.ok(!err, err); assert.ok(result.analyses.moran); - assert.equal(result.analyses.moran.timeout, 5000); + assert.strictEqual(result.analyses.moran.timeout, 5000); assert.ok(result.analyses.kmeans); - assert.equal(result.analyses.kmeans.timeout, 1000); + assert.strictEqual(result.analyses.kmeans.timeout, 1000); done(); }); @@ -157,8 +157,8 @@ describe('analysis-backend limits', function () { assert.ok(!err, err); assert.ok(result.analyses['aggregate-intersection']); - assert.equal(result.analyses['aggregate-intersection'].timeout, 5000); - assert.equal(result.analyses['aggregate-intersection'].maxNumberOfRows, 1e5); + assert.strictEqual(result.analyses['aggregate-intersection'].timeout, 5000); + assert.strictEqual(result.analyses['aggregate-intersection'].maxNumberOfRows, 1e5); done(); }); diff --git a/test/integration/mapconfig-named-layers-datasource-test.js b/test/integration/mapconfig-named-layers-datasource-test.js index 0dd3bd6e..1f696124 100644 --- a/test/integration/mapconfig-named-layers-datasource-test.js +++ b/test/integration/mapconfig-named-layers-datasource-test.js @@ -143,10 +143,10 @@ describe('named_layers datasources', function () { config: makeNamedMapLayerConfig([wadusLayer]), test: function (err, layers, datasource, done) { assert.ok(!err); - assert.equal(layers.length, 1); + assert.strictEqual(layers.length, 1); - assert.equal(layers[0].type, 'cartodb'); - assert.equal(layers[0].options.sql, wadusSql); + assert.strictEqual(layers[0].type, 'cartodb'); + assert.strictEqual(layers[0].options.sql, wadusSql); assert.deepEqual(datasource.getLayerDatasource(0), {}); done(); @@ -158,14 +158,14 @@ describe('named_layers datasources', function () { config: makeNamedMapLayerConfig([wadusLayer, simpleNamedLayer]), test: function (err, layers, datasource, done) { assert.ok(!err); - assert.equal(layers.length, 2); + assert.strictEqual(layers.length, 2); - assert.equal(layers[0].type, 'cartodb'); - assert.equal(layers[0].options.sql, wadusSql); + assert.strictEqual(layers[0].type, 'cartodb'); + assert.strictEqual(layers[0].options.sql, wadusSql); assert.deepEqual(datasource.getLayerDatasource(0), {}); - assert.equal(layers[1].type, 'cartodb'); - assert.equal(layers[1].options.sql, wadusTemplateSql); + assert.strictEqual(layers[1].type, 'cartodb'); + assert.strictEqual(layers[1].options.sql, wadusTemplateSql); var layerDatasource = datasource.getLayerDatasource(1); assert.notEqual(layerDatasource, undefined); assert.ok(layerDatasource.user); @@ -179,20 +179,20 @@ describe('named_layers datasources', function () { config: makeNamedMapLayerConfig([wadusLayer, multipleLayersNamedLayer]), test: function (err, layers, datasource, done) { assert.ok(!err); - assert.equal(layers.length, 3); + assert.strictEqual(layers.length, 3); - assert.equal(layers[0].type, 'cartodb'); - assert.equal(layers[0].options.sql, wadusSql); + assert.strictEqual(layers[0].type, 'cartodb'); + assert.strictEqual(layers[0].options.sql, wadusSql); assert.deepEqual(datasource.getLayerDatasource(0), {}); - assert.equal(layers[1].type, 'mapnik'); - assert.equal(layers[1].options.sql, wadusMapnikSql); + assert.strictEqual(layers[1].type, 'mapnik'); + assert.strictEqual(layers[1].options.sql, wadusMapnikSql); var layerDatasource = datasource.getLayerDatasource(1); assert.notEqual(layerDatasource, undefined); assert.ok(layerDatasource.user); - assert.equal(layers[2].type, 'cartodb'); - assert.equal(layers[2].options.sql, wadusTemplateSql); + assert.strictEqual(layers[2].type, 'cartodb'); + assert.strictEqual(layers[2].options.sql, wadusTemplateSql); layerDatasource = datasource.getLayerDatasource(2); assert.notEqual(layerDatasource, undefined); assert.ok(layerDatasource.user); @@ -206,22 +206,22 @@ describe('named_layers datasources', function () { config: makeNamedMapLayerConfig([multipleLayersNamedLayer, simpleNamedLayer]), test: function (err, layers, datasource, done) { assert.ok(!err); - assert.equal(layers.length, 3); + assert.strictEqual(layers.length, 3); - assert.equal(layers[0].type, 'mapnik'); - assert.equal(layers[0].options.sql, wadusMapnikSql); + assert.strictEqual(layers[0].type, 'mapnik'); + assert.strictEqual(layers[0].options.sql, wadusMapnikSql); var layerDatasource = datasource.getLayerDatasource(0); assert.notEqual(layerDatasource, undefined); assert.ok(layerDatasource.user); - assert.equal(layers[1].type, 'cartodb'); - assert.equal(layers[1].options.sql, wadusTemplateSql); + assert.strictEqual(layers[1].type, 'cartodb'); + assert.strictEqual(layers[1].options.sql, wadusTemplateSql); layerDatasource = datasource.getLayerDatasource(1); assert.notEqual(layerDatasource, undefined); assert.ok(layerDatasource.user); - assert.equal(layers[2].type, 'cartodb'); - assert.equal(layers[2].options.sql, wadusTemplateSql); + assert.strictEqual(layers[2].type, 'cartodb'); + assert.strictEqual(layers[2].options.sql, wadusTemplateSql); layerDatasource = datasource.getLayerDatasource(2); assert.notEqual(layerDatasource, undefined); assert.ok(layerDatasource.user); @@ -242,48 +242,48 @@ describe('named_layers datasources', function () { ]), test: function (err, layers, datasource, done) { assert.ok(!err); - assert.equal(layers.length, 8); + assert.strictEqual(layers.length, 8); - assert.equal(layers[0].type, 'cartodb'); - assert.equal(layers[0].options.sql, wadusTemplateSql); + assert.strictEqual(layers[0].type, 'cartodb'); + assert.strictEqual(layers[0].options.sql, wadusTemplateSql); var layerDatasource = datasource.getLayerDatasource(0); assert.notEqual(layerDatasource, undefined); assert.ok(layerDatasource.user); - assert.equal(layers[1].type, 'mapnik'); - assert.equal(layers[1].options.sql, wadusMapnikSql); + assert.strictEqual(layers[1].type, 'mapnik'); + assert.strictEqual(layers[1].options.sql, wadusMapnikSql); layerDatasource = datasource.getLayerDatasource(1); assert.notEqual(layerDatasource, undefined); assert.ok(layerDatasource.user); - assert.equal(layers[2].type, 'cartodb'); - assert.equal(layers[2].options.sql, wadusTemplateSql); + assert.strictEqual(layers[2].type, 'cartodb'); + assert.strictEqual(layers[2].options.sql, wadusTemplateSql); layerDatasource = datasource.getLayerDatasource(2); assert.notEqual(layerDatasource, undefined); assert.ok(layerDatasource.user); - assert.equal(layers[3].type, 'cartodb'); - assert.equal(layers[3].options.sql, wadusSql); + assert.strictEqual(layers[3].type, 'cartodb'); + assert.strictEqual(layers[3].options.sql, wadusSql); assert.deepEqual(datasource.getLayerDatasource(3), {}); - assert.equal(layers[4].type, 'cartodb'); - assert.equal(layers[4].options.sql, wadusTemplateSql); + assert.strictEqual(layers[4].type, 'cartodb'); + assert.strictEqual(layers[4].options.sql, wadusTemplateSql); layerDatasource = datasource.getLayerDatasource(4); assert.notEqual(layerDatasource, undefined); assert.ok(layerDatasource.user); - assert.equal(layers[5].type, 'cartodb'); - assert.equal(layers[5].options.sql, wadusSql); + assert.strictEqual(layers[5].type, 'cartodb'); + assert.strictEqual(layers[5].options.sql, wadusSql); assert.deepEqual(datasource.getLayerDatasource(5), {}); - assert.equal(layers[6].type, 'mapnik'); - assert.equal(layers[6].options.sql, wadusMapnikSql); + assert.strictEqual(layers[6].type, 'mapnik'); + assert.strictEqual(layers[6].options.sql, wadusMapnikSql); layerDatasource = datasource.getLayerDatasource(6); assert.notEqual(layerDatasource, undefined); assert.ok(layerDatasource.user); - assert.equal(layers[7].type, 'cartodb'); - assert.equal(layers[7].options.sql, wadusTemplateSql); + assert.strictEqual(layers[7].type, 'cartodb'); + assert.strictEqual(layers[7].options.sql, wadusTemplateSql); layerDatasource = datasource.getLayerDatasource(7); assert.notEqual(layerDatasource, undefined); assert.ok(layerDatasource.user); diff --git a/test/integration/mapconfig-named-layers-expanded-test.js b/test/integration/mapconfig-named-layers-expanded-test.js index f5ce1c72..64524044 100644 --- a/test/integration/mapconfig-named-layers-expanded-test.js +++ b/test/integration/mapconfig-named-layers-expanded-test.js @@ -155,7 +155,7 @@ describe('mapconfig-named-layers-adapter', function () { assert.ok(err); assert.ok(!mapConfig); assert.ok(!context.datasource); - assert.equal(err.message, 'Missing Named Map `name` in layer options'); + assert.strictEqual(err.message, 'Missing Named Map `name` in layer options'); done(); } @@ -172,7 +172,7 @@ describe('mapconfig-named-layers-adapter', function () { assert.ok(err); assert.ok(!mapConfig); assert.ok(!context.datasource); - assert.equal( + assert.strictEqual( err.message, "Template '" + missingTemplateName + "' of user '" + username + "' not found" ); @@ -195,7 +195,7 @@ describe('mapconfig-named-layers-adapter', function () { assert.ok(err); assert.ok(!mapConfig); assert.ok(!context.datasource); - assert.equal(err.message, "Unauthorized '" + tokenAuthTemplateName + "' template instantiation"); + assert.strictEqual(err.message, "Unauthorized '" + tokenAuthTemplateName + "' template instantiation"); templateMaps.delTemplate(username, tokenAuthTemplateName, done); } @@ -217,7 +217,7 @@ describe('mapconfig-named-layers-adapter', function () { assert.ok(err); assert.ok(!mapConfig); assert.ok(!context.datasource); - assert.equal(err.message, 'Nested named layers are not allowed'); + assert.strictEqual(err.message, 'Nested named layers are not allowed'); templateMaps.delTemplate(username, nestedNamedMapTemplateName, done); } @@ -256,7 +256,7 @@ describe('mapconfig-named-layers-adapter', function () { function (err, mapConfig) { assert.ok(!err); var layers = mapConfig.layers; - assert.equal(layers.length, 1); + assert.strictEqual(layers.length, 1); assert.notEqual(context.datasource.getLayerDatasource(0), undefined); templateMaps.delTemplate(username, tokenAuthTemplateName, done); @@ -279,14 +279,14 @@ describe('mapconfig-named-layers-adapter', function () { function (err, mapConfig) { assert.ok(!err); var layers = mapConfig.layers; - assert.equal(layers.length, 2); + assert.strictEqual(layers.length, 2); - assert.equal(layers[0].type, 'mapnik'); - assert.equal(layers[0].options.cartocss, '#layer { polygon-fill: green; }'); + assert.strictEqual(layers[0].type, 'mapnik'); + assert.strictEqual(layers[0].options.cartocss, '#layer { polygon-fill: green; }'); assert.notEqual(context.datasource.getLayerDatasource(0), undefined); - assert.equal(layers[1].type, 'cartodb'); - assert.equal(layers[1].options.cartocss, '#layer { marker-fill: red; }'); + assert.strictEqual(layers[1].type, 'cartodb'); + assert.strictEqual(layers[1].options.cartocss, '#layer { marker-fill: red; }'); assert.notEqual(context.datasource.getLayerDatasource(1), undefined); templateMaps.delTemplate(username, multipleLayersTemplateName, done); @@ -316,14 +316,14 @@ describe('mapconfig-named-layers-adapter', function () { function (err, mapConfig) { assert.ok(!err); var layers = mapConfig.layers; - assert.equal(layers.length, 2); + assert.strictEqual(layers.length, 2); - assert.equal(layers[0].type, 'mapnik'); - assert.equal(layers[0].options.cartocss, '#layer { polygon-fill: ' + polygonColor + '; }'); + assert.strictEqual(layers[0].type, 'mapnik'); + assert.strictEqual(layers[0].options.cartocss, '#layer { polygon-fill: ' + polygonColor + '; }'); assert.notEqual(context.datasource.getLayerDatasource(0), undefined); - assert.equal(layers[1].type, 'cartodb'); - assert.equal(layers[1].options.cartocss, '#layer { marker-fill: ' + color + '; }'); + assert.strictEqual(layers[1].type, 'cartodb'); + assert.strictEqual(layers[1].options.cartocss, '#layer { marker-fill: ' + color + '; }'); assert.notEqual(context.datasource.getLayerDatasource(1), undefined); templateMaps.delTemplate(username, multipleLayersTemplateName, done); diff --git a/test/integration/mapconfig-overviews-adapter-test.js b/test/integration/mapconfig-overviews-adapter-test.js index bd57e27e..0fd10f61 100644 --- a/test/integration/mapconfig-overviews-adapter-test.js +++ b/test/integration/mapconfig-overviews-adapter-test.js @@ -44,12 +44,12 @@ describe('MapConfigOverviewsAdapter', function () { mapConfigOverviewsAdapter.getMapConfig('localhost', _mapConfig, params, context, function (err, mapConfig) { assert.ok(!err); var layers = mapConfig.layers; - assert.equal(layers.length, 1); - assert.equal(layers[0].type, 'cartodb'); - assert.equal(layers[0].options.sql, sql); - assert.equal(layers[0].options.cartocss, cartocss); - assert.equal(layers[0].options.cartocss_version, cartocss_version); - assert.equal(layers[0].options.overviews, undefined); + assert.strictEqual(layers.length, 1); + assert.strictEqual(layers[0].type, 'cartodb'); + assert.strictEqual(layers[0].options.sql, sql); + assert.strictEqual(layers[0].options.cartocss, cartocss); + assert.strictEqual(layers[0].options.cartocss_version, cartocss_version); + assert.strictEqual(layers[0].options.overviews, undefined); done(); }); }); @@ -79,11 +79,11 @@ describe('MapConfigOverviewsAdapter', function () { mapConfigOverviewsAdapter.getMapConfig('localhost', _mapConfig, params, context, function (err, mapConfig) { assert.ok(!err); var layers = mapConfig.layers; - assert.equal(layers.length, 1); - assert.equal(layers[0].type, 'cartodb'); - assert.equal(layers[0].options.sql, sql); - assert.equal(layers[0].options.cartocss, cartocss); - assert.equal(layers[0].options.cartocss_version, cartocss_version); + assert.strictEqual(layers.length, 1); + assert.strictEqual(layers[0].type, 'cartodb'); + assert.strictEqual(layers[0].options.sql, sql); + assert.strictEqual(layers[0].options.cartocss, cartocss); + assert.strictEqual(layers[0].options.cartocss_version, cartocss_version); assert.ok(layers[0].options.query_rewrite_data); var expected_data = { overviews: { diff --git a/test/integration/pg-query-runner-test.js b/test/integration/pg-query-runner-test.js index c04969d8..182da582 100644 --- a/test/integration/pg-query-runner-test.js +++ b/test/integration/pg-query-runner-test.js @@ -26,7 +26,7 @@ describe('PgQueryRunner', function () { assert.ok(!err, err); assert.ok(Array.isArray(result)); - assert.equal(result.length, 3); + assert.strictEqual(result.length, 3); done(); }); @@ -38,7 +38,7 @@ describe('PgQueryRunner', function () { assert.ok(err); assert.ok(Array.isArray(result)); - assert.equal(result.length, 0); + assert.strictEqual(result.length, 0); done(); }); diff --git a/test/integration/profiler-test.js b/test/integration/profiler-test.js index 75a649fb..291b29f1 100644 --- a/test/integration/profiler-test.js +++ b/test/integration/profiler-test.js @@ -40,7 +40,7 @@ describe('profiler + statsd', function () { // force a call to validate sendStats does not throw and uncaught exception statsClient.timing('forced', 50, 1, function (err) { assert.ok(err); - assert.equal(err.code, 'ENOTFOUND'); + assert.strictEqual(err.code, 'ENOTFOUND'); done(); }); }); diff --git a/test/integration/query-tables-test.js b/test/integration/query-tables-test.js index 67689866..f93472aa 100644 --- a/test/integration/query-tables-test.js +++ b/test/integration/query-tables-test.js @@ -34,12 +34,12 @@ describe('QueryTables', function () { var query = 'select * from test_table'; return QueryTables.getQueryMetadataModel(connection, query) .then(result => { - assert.equal(result.getLastUpdatedAt(), 1234567890123); + assert.strictEqual(result.getLastUpdatedAt(), 1234567890123); - assert.equal(result.tables.length, 1); - assert.equal(result.tables[0].dbname, 'test_windshaft_cartodb_user_1_db'); - assert.equal(result.tables[0].schema_name, 'public'); - assert.equal(result.tables[0].table_name, 'test_table'); + assert.strictEqual(result.tables.length, 1); + assert.strictEqual(result.tables[0].dbname, 'test_windshaft_cartodb_user_1_db'); + assert.strictEqual(result.tables[0].schema_name, 'public'); + assert.strictEqual(result.tables[0].table_name, 'test_table'); }); }); @@ -47,12 +47,12 @@ describe('QueryTables', function () { var query = 'select * from test_table_private_1'; return QueryTables.getQueryMetadataModel(connection, query) .then(result => { - assert.equal(result.getLastUpdatedAt(), 1234567890123); + assert.strictEqual(result.getLastUpdatedAt(), 1234567890123); - assert.equal(result.tables.length, 1); - assert.equal(result.tables[0].dbname, 'test_windshaft_cartodb_user_1_db'); - assert.equal(result.tables[0].schema_name, 'public'); - assert.equal(result.tables[0].table_name, 'test_table_private_1'); + assert.strictEqual(result.tables.length, 1); + assert.strictEqual(result.tables[0].dbname, 'test_windshaft_cartodb_user_1_db'); + assert.strictEqual(result.tables[0].schema_name, 'public'); + assert.strictEqual(result.tables[0].table_name, 'test_table_private_1'); }); }); }); diff --git a/test/integration/template-maps-limits-test.js b/test/integration/template-maps-limits-test.js index dd9dfb8a..2619a57a 100644 --- a/test/integration/template-maps-limits-test.js +++ b/test/integration/template-maps-limits-test.js @@ -70,7 +70,7 @@ describe('TemplateMaps limits', function () { assert.ok(template); templateMaps.addTemplate(OWNER, createTemplate(), function (err) { assert.ok(err); - assert.equal(err.http_status, 409); + assert.strictEqual(err.http_status, 409); done(); }); }); diff --git a/test/support/test-helper.js b/test/support/test-helper.js index 9ec194dd..bc98b31b 100644 --- a/test/support/test-helper.js +++ b/test/support/test-helper.js @@ -84,7 +84,7 @@ beforeEach(function () { }); // global afterEach to capture uncaught exceptions afterEach(function () { - assert.equal( + assert.strictEqual( uncaughtExceptions.length, 0, 'uncaughtException:\n\n' + uncaughtExceptions.map(err => err.stack).join('\n\n')); @@ -129,7 +129,7 @@ afterEach(function (done) { }); if (Object.keys(databasesTasks).length === 0) { - assert.equal(keysFound.length, 0, 'Unexpected keys found in redis: ' + keysFound.join(', ')); + assert.strictEqual(keysFound.length, 0, 'Unexpected keys found in redis: ' + keysFound.join(', ')); done(); } } diff --git a/test/unit/backends/layer-stats/mapnik-layer-stats-test.js b/test/unit/backends/layer-stats/mapnik-layer-stats-test.js index a96da4b3..3d8e053c 100644 --- a/test/unit/backends/layer-stats/mapnik-layer-stats-test.js +++ b/test/unit/backends/layer-stats/mapnik-layer-stats-test.js @@ -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(); }); }); diff --git a/test/unit/cache/model/named-maps-entry-test.js b/test/unit/cache/model/named-maps-entry-test.js index 7b514447..e16bf306 100644 --- a/test/unit/cache/model/named-maps-entry-test.js +++ b/test/unit/cache/model/named-maps-entry-test.js @@ -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'); }); }); diff --git a/test/unit/cdb-request-test.js b/test/unit/cdb-request-test.js index fe1da3bf..3e1880f7 100644 --- a/test/unit/cdb-request-test.js +++ b/test/unit/cdb-request-test.js @@ -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); }); }); diff --git a/test/unit/error-middleware-test.js b/test/unit/error-middleware-test.js index 6b2bace2..717b9b26 100644 --- a/test/unit/error-middleware-test.js +++ b/test/unit/error-middleware-test.js @@ -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' diff --git a/test/unit/lzma-middleware-test.js b/test/unit/lzma-middleware-test.js index c35e3ae3..b497bfc3 100644 --- a/test/unit/lzma-middleware-test.js +++ b/test/unit/lzma-middleware-test.js @@ -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(); }); }); diff --git a/test/unit/mapconfig/adapter-test.js b/test/unit/mapconfig/adapter-test.js index 36746fcc..23ce2387 100644 --- a/test/unit/mapconfig/adapter-test.js +++ b/test/unit/mapconfig/adapter-test.js @@ -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); }); } diff --git a/test/unit/middlewares/coordinates-test.js b/test/unit/middlewares/coordinates-test.js index b8baa5df..0e443be0 100644 --- a/test/unit/middlewares/coordinates-test.js +++ b/test/unit/middlewares/coordinates-test.js @@ -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(); }); }); diff --git a/test/unit/model/filter/bbox-filters-test.js b/test/unit/model/filter/bbox-filters-test.js index 2d317c52..f28edc66 100644 --- a/test/unit/model/filter/bbox-filters-test.js +++ b/test/unit/model/filter/bbox-filters-test.js @@ -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], diff --git a/test/unit/model/resource-locator-test.js b/test/unit/model/resource-locator-test.js index 251d96a0..c811f0bc 100644 --- a/test/unit/model/resource-locator-test.js +++ b/test/unit/model/resource-locator-test.js @@ -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}` ); diff --git a/test/unit/overviews-query-rewriter-test.js b/test/unit/overviews-query-rewriter-test.js index 715d0ccb..2bc375e0 100644 --- a/test/unit/overviews-query-rewriter-test.js +++ b/test/unit/overviews-query-rewriter-test.js @@ -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); }); }); diff --git a/test/unit/ported/profiler-test.js b/test/unit/ported/profiler-test.js index 45bafe4b..e9a0f9b4 100644 --- a/test/unit/ported/profiler-test.js +++ b/test/unit/ported/profiler-test.js @@ -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 () { diff --git a/test/unit/ported/stats-client-test.js b/test/unit/ported/stats-client-test.js index 46ad64ce..741d7ed6 100644 --- a/test/unit/ported/stats-client-test.js +++ b/test/unit/ported/stats-client-test.js @@ -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(); diff --git a/test/unit/ported/windshaft-server-test.js b/test/unit/ported/windshaft-server-test.js index 9e3888fa..14de3983 100644 --- a/test/unit/ported/windshaft-server-test.js +++ b/test/unit/ported/windshaft-server-test.js @@ -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 () { diff --git a/test/unit/prepare-context-test.js b/test/unit/prepare-context-test.js index 38368a06..c6a311fd 100644 --- a/test/unit/prepare-context-test.js +++ b/test/unit/prepare-context-test.js @@ -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(); }); }); diff --git a/test/unit/substitution-tokens-test.js b/test/unit/substitution-tokens-test.js index 54bab374..5da21453 100644 --- a/test/unit/substitution-tokens-test.js +++ b/test/unit/substitution-tokens-test.js @@ -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); }); }); diff --git a/test/unit/table-name-parser-test.js b/test/unit/table-name-parser-test.js index f74b9422..aaa24d9b 100644 --- a/test/unit/table-name-parser-test.js +++ b/test/unit/table-name-parser-test.js @@ -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(); }); }); diff --git a/test/unit/template-maps-auth-test.js b/test/unit/template-maps-auth-test.js index 448d579e..60ad8732 100644 --- a/test/unit/template-maps-auth-test.js +++ b/test/unit/template-maps-auth-test.js @@ -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(); }); }); diff --git a/test/unit/template-maps-defaults-test.js b/test/unit/template-maps-defaults-test.js index 2dd1c47f..0f34c2f9 100644 --- a/test/unit/template-maps-defaults-test.js +++ b/test/unit/template-maps-defaults-test.js @@ -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); diff --git a/test/unit/template-maps-test.js b/test/unit/template-maps-test.js index 71772216..6f3ce55f 100644 --- a/test/unit/template-maps-test.js +++ b/test/unit/template-maps-test.js @@ -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); diff --git a/test/unit/utils/date-wrapper-test.js b/test/unit/utils/date-wrapper-test.js index 9e5691d6..b712fc6e 100644 --- a/test/unit/utils/date-wrapper-test.js +++ b/test/unit/utils/date-wrapper-test.js @@ -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); }); }); diff --git a/test/unit/valid-template-maps-test.js b/test/unit/valid-template-maps-test.js index 89632b76..94fa7706 100644 --- a/test/unit/valid-template-maps-test.js +++ b/test/unit/valid-template-maps-test.js @@ -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(); } });