diff --git a/samples/package.json b/samples/package.json index 8e93daf8..2f6f5a07 100644 --- a/samples/package.json +++ b/samples/package.json @@ -6,7 +6,7 @@ "author": "Google LLC", "repository": "googleapis/nodejs-bigquery", "engines": { - "node": ">=6" + "node": ">=8" }, "scripts": { "test": "npm run cover", diff --git a/samples/system-test/tables.test.js b/samples/system-test/tables.test.js index 82f8f232..f7656cb6 100644 --- a/samples/system-test/tables.test.js +++ b/samples/system-test/tables.test.js @@ -117,7 +117,7 @@ test.serial(`should load a local file`, async t => { .dataset(datasetId) .table(tableId) .getRows(); - assert.equal(rows.length, 1); + assert.strictEqual(rows.length, 1); }) .start(); }); diff --git a/samples/tables.js b/samples/tables.js index abf8b8ba..77e0bd3e 100644 --- a/samples/tables.js +++ b/samples/tables.js @@ -183,7 +183,7 @@ function copyTable( const job = results[0]; // load() waits for the job to finish - assert.equal(job.status.state, 'DONE'); + assert.strictEqual(job.status.state, 'DONE'); console.log(`Job ${job.id} completed.`); // Check the job's status for errors @@ -225,7 +225,7 @@ function loadLocalFile(datasetId, tableId, filename, projectId) { const job = results[0]; // load() waits for the job to finish - assert.equal(job.status.state, 'DONE'); + assert.strictEqual(job.status.state, 'DONE'); console.log(`Job ${job.id} completed.`); // Check the job's status for errors @@ -292,7 +292,7 @@ function loadParquetFromGCS(datasetId, tableId, projectId) { const job = results[0]; // load() waits for the job to finish - assert.equal(job.status.state, 'DONE'); + assert.strictEqual(job.status.state, 'DONE'); console.log(`Job ${job.id} completed.`); // Check the job's status for errors @@ -360,7 +360,7 @@ function loadCSVFromGCS(datasetId, tableId, projectId) { const job = results[0]; // load() waits for the job to finish - assert.equal(job.status.state, 'DONE'); + assert.strictEqual(job.status.state, 'DONE'); console.log(`Job ${job.id} completed.`); // Check the job's status for errors @@ -423,7 +423,7 @@ function loadCSVFromGCSAutodetect(datasetId, tableId, projectId) { const job = results[0]; // load() waits for the job to finish - assert.equal(job.status.state, 'DONE'); + assert.strictEqual(job.status.state, 'DONE'); console.log(`Job ${job.id} completed.`); // Check the job's status for errors @@ -493,7 +493,7 @@ function loadCSVFromGCSAppend(datasetId, tableId, projectId) { const job = results[0]; // load() waits for the job to finish - assert.equal(job.status.state, 'DONE'); + assert.strictEqual(job.status.state, 'DONE'); console.log(`Job ${job.id} completed.`); // Check the job's status for errors @@ -563,7 +563,7 @@ function loadCSVFromGCSTruncate(datasetId, tableId, projectId) { const job = results[0]; // load() waits for the job to finish - assert.equal(job.status.state, 'DONE'); + assert.strictEqual(job.status.state, 'DONE'); console.log(`Job ${job.id} completed.`); // Check the job's status for errors @@ -617,7 +617,7 @@ function extractTableToGCS( const job = results[0]; // load() waits for the job to finish - assert.equal(job.status.state, 'DONE'); + assert.strictEqual(job.status.state, 'DONE'); console.log(`Job ${job.id} completed.`); // Check the job's status for errors diff --git a/system-test/bigquery.js b/system-test/bigquery.js index cc69e4cc..4d7839e2 100644 --- a/system-test/bigquery.js +++ b/system-test/bigquery.js @@ -261,8 +261,8 @@ describe('BigQuery', function() { rowsEmitted.push(row); }) .on('end', function() { - assert.equal(rowsEmitted.length, 100); - assert.equal(typeof rowsEmitted[0].url, 'string'); + assert.strictEqual(rowsEmitted.length, 100); + assert.strictEqual(typeof rowsEmitted[0].url, 'string'); done(); }); }); @@ -319,11 +319,11 @@ describe('BigQuery', function() { .createQueryStream(query) .on('data', function(row) { rowsEmitted++; - assert.equal(typeof row.url, 'string'); + assert.strictEqual(typeof row.url, 'string'); }) .on('error', done) .on('end', function() { - assert.equal(rowsEmitted, 100); + assert.strictEqual(rowsEmitted, 100); done(); }); }); @@ -331,7 +331,7 @@ describe('BigQuery', function() { it('should query', function(done) { bigquery.query(query, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 100); + assert.strictEqual(rows.length, 100); done(); }); }); @@ -344,8 +344,8 @@ describe('BigQuery', function() { }, function(err, rows, nextQuery) { assert.ifError(err); - assert.equal(rows.length, 10); - assert.equal(typeof nextQuery.pageToken, 'string'); + assert.strictEqual(rows.length, 10); + assert.strictEqual(typeof nextQuery.pageToken, 'string'); done(); } ); @@ -359,7 +359,7 @@ describe('BigQuery', function() { }, function(err, rows, resp) { assert.ifError(err); - assert.deepEqual(rows, []); + assert.deepStrictEqual(rows, []); assert(resp.statistics.query); done(); } @@ -416,7 +416,7 @@ describe('BigQuery', function() { dataset.getMetadata(function(err, metadata) { assert.ifError(err); - assert.equal(metadata.description, 'yay description'); + assert.strictEqual(metadata.description, 'yay description'); done(); }); } @@ -509,7 +509,7 @@ describe('BigQuery', function() { table.getMetadata(function(err, metadata) { assert.ifError(err); - assert.deepEqual(metadata.schema, { + assert.deepStrictEqual(metadata.schema, { fields: [ { name: 'id', @@ -717,7 +717,7 @@ describe('BigQuery', function() { var TEST_DATA_JSON_PATH = require.resolve('./data/kitten-test-data.json'); it('should have created the correct schema', function() { - assert.deepEqual(table.metadata.schema.fields, SCHEMA); + assert.deepStrictEqual(table.metadata.schema.fields, SCHEMA); }); it('should get the rows in a table', function(done) { @@ -762,7 +762,7 @@ describe('BigQuery', function() { table.getMetadata(function(err, metadata) { assert.ifError(err); - assert.equal(metadata.description, 'catsandstuff'); + assert.strictEqual(metadata.description, 'catsandstuff'); done(); }); } @@ -928,7 +928,7 @@ describe('BigQuery', function() { table.insert([data, improperData], function(err) { assert.strictEqual(err.name, 'PartialFailureError'); - assert.deepEqual(err.errors[0], { + assert.deepStrictEqual(err.errors[0], { errors: [ { message: 'Conversion from bool to string is unsupported.', @@ -938,7 +938,7 @@ describe('BigQuery', function() { row: improperData, }); - assert.deepEqual(err.errors[1], { + assert.deepStrictEqual(err.errors[1], { errors: [ { message: '', @@ -999,7 +999,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 1); + assert.strictEqual(rows.length, 1); done(); } ); @@ -1018,7 +1018,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 1); + assert.strictEqual(rows.length, 1); done(); } ); @@ -1037,7 +1037,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 1); + assert.strictEqual(rows.length, 1); done(); } ); @@ -1055,7 +1055,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 1); + assert.strictEqual(rows.length, 1); done(); } ); @@ -1074,7 +1074,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 1); + assert.strictEqual(rows.length, 1); done(); } ); @@ -1088,7 +1088,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 5); + assert.strictEqual(rows.length, 5); done(); } ); @@ -1112,7 +1112,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 1); + assert.strictEqual(rows.length, 1); done(); } ); @@ -1131,7 +1131,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 1); + assert.strictEqual(rows.length, 1); done(); } ); @@ -1145,7 +1145,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 1); + assert.strictEqual(rows.length, 1); done(); } ); @@ -1159,7 +1159,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 1); + assert.strictEqual(rows.length, 1); done(); } ); @@ -1173,7 +1173,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 1); + assert.strictEqual(rows.length, 1); done(); } ); @@ -1193,7 +1193,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 1); + assert.strictEqual(rows.length, 1); done(); } ); @@ -1215,7 +1215,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 1); + assert.strictEqual(rows.length, 1); done(); } ); @@ -1236,7 +1236,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 1); + assert.strictEqual(rows.length, 1); done(); } ); @@ -1257,7 +1257,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 1); + assert.strictEqual(rows.length, 1); done(); } ); @@ -1277,7 +1277,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 1); + assert.strictEqual(rows.length, 1); done(); } ); @@ -1298,7 +1298,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 1); + assert.strictEqual(rows.length, 1); done(); } ); @@ -1314,7 +1314,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 5); + assert.strictEqual(rows.length, 5); done(); } ); @@ -1338,7 +1338,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 1); + assert.strictEqual(rows.length, 1); done(); } ); @@ -1359,7 +1359,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 1); + assert.strictEqual(rows.length, 1); done(); } ); @@ -1375,7 +1375,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 1); + assert.strictEqual(rows.length, 1); done(); } ); @@ -1391,7 +1391,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 1); + assert.strictEqual(rows.length, 1); done(); } ); @@ -1407,7 +1407,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 1); + assert.strictEqual(rows.length, 1); done(); } ); @@ -1432,7 +1432,7 @@ describe('BigQuery', function() { }, function(err, rows) { assert.ifError(err); - assert.equal(rows.length, 1); + assert.strictEqual(rows.length, 1); done(); } ); @@ -1613,7 +1613,7 @@ describe('BigQuery', function() { rows.forEach(function(row) { var expectedRow = EXPECTED_ROWS[row.Name]; - assert.deepEqual(row, expectedRow); + assert.deepStrictEqual(row, expectedRow); }); done(); diff --git a/test/dataset.js b/test/dataset.js index 56da63e8..5a4074f8 100644 --- a/test/dataset.js +++ b/test/dataset.js @@ -33,7 +33,7 @@ var fakeUtil = extend({}, util, { } promisified = true; - assert.deepEqual(options.exclude, ['table']); + assert.deepStrictEqual(options.exclude, ['table']); }, }); @@ -45,8 +45,8 @@ var fakePaginator = { } methods = arrify(methods); - assert.equal(Class.name, 'Dataset'); - assert.deepEqual(methods, ['getTables']); + assert.strictEqual(Class.name, 'Dataset'); + assert.deepStrictEqual(methods, ['getTables']); extended = true; }, streamify: function(methodName) { @@ -109,7 +109,7 @@ describe('BigQuery/Dataset', function() { assert.strictEqual(calledWith.parent, BIGQUERY); assert.strictEqual(calledWith.baseUrl, '/datasets'); assert.strictEqual(calledWith.id, DATASET_ID); - assert.deepEqual(calledWith.methods, { + assert.deepStrictEqual(calledWith.methods, { create: true, exists: true, get: true, @@ -141,7 +141,7 @@ describe('BigQuery/Dataset', function() { bq.createDataset = function(id, options, callback) { assert.strictEqual(id, DATASET_ID); - assert.deepEqual(options, OPTIONS); + assert.deepStrictEqual(options, OPTIONS); callback(); // the done fn }; @@ -181,7 +181,7 @@ describe('BigQuery/Dataset', function() { }; var reqOpts = interceptor.request(fakeReqOpts); - assert.deepEqual(reqOpts.headers, {'If-Match': FAKE_ETAG}); + assert.deepStrictEqual(reqOpts.headers, {'If-Match': FAKE_ETAG}); }); it('should respect already existing headers', function() { @@ -202,7 +202,7 @@ describe('BigQuery/Dataset', function() { }); var reqOpts = interceptor.request(fakeReqOpts); - assert.deepEqual(reqOpts.headers, expectedHeaders); + assert.deepStrictEqual(reqOpts.headers, expectedHeaders); }); it('should not apply the header if method is not patch', function() { @@ -216,7 +216,7 @@ describe('BigQuery/Dataset', function() { }; var reqOpts = interceptor.request(fakeReqOpts); - assert.deepEqual(reqOpts.headers, undefined); + assert.deepStrictEqual(reqOpts.headers, undefined); }); }); }); @@ -244,7 +244,7 @@ describe('BigQuery/Dataset', function() { ); ds.bigQuery.createQueryJob = function(options, callback) { - assert.deepEqual(options, expectedOptions); + assert.deepStrictEqual(options, expectedOptions); assert.notStrictEqual(fakeOptions, options); callback(); // the done fn }; @@ -291,7 +291,7 @@ describe('BigQuery/Dataset', function() { var query = 'SELECT * FROM allthedata'; ds.bigQuery.createQueryStream = function(opts) { - assert.equal(opts.query, query); + assert.strictEqual(opts.query, query); done(); }; @@ -300,8 +300,8 @@ describe('BigQuery/Dataset', function() { it('should pass along options', function(done) { ds.bigQuery.createQueryStream = function(opts) { - assert.equal(opts.a, options.a); - assert.equal(opts.c, options.c); + assert.strictEqual(opts.a, options.a); + assert.strictEqual(opts.c, options.c); done(); }; @@ -310,7 +310,7 @@ describe('BigQuery/Dataset', function() { it('should extend options with defaultDataset', function(done) { ds.bigQuery.createQueryStream = function(opts) { - assert.deepEqual(opts.defaultDataset, {datasetId: ds.id}); + assert.deepStrictEqual(opts.defaultDataset, {datasetId: ds.id}); done(); }; @@ -329,7 +329,7 @@ describe('BigQuery/Dataset', function() { it('should not modify original options object', function(done) { ds.bigQuery.createQueryStream = function() { - assert.deepEqual(options, {a: 'b', c: 'd'}); + assert.deepStrictEqual(options, {a: 'b', c: 'd'}); done(); }; @@ -366,10 +366,13 @@ describe('BigQuery/Dataset', function() { assert.strictEqual(reqOpts.uri, '/tables'); var body = reqOpts.json; - assert.deepEqual(body.schema, SCHEMA_OBJECT); - assert.equal(body.tableReference.datasetId, DATASET_ID); - assert.equal(body.tableReference.projectId, ds.bigQuery.projectId); - assert.equal(body.tableReference.tableId, TABLE_ID); + assert.deepStrictEqual(body.schema, SCHEMA_OBJECT); + assert.strictEqual(body.tableReference.datasetId, DATASET_ID); + assert.strictEqual( + body.tableReference.projectId, + ds.bigQuery.projectId + ); + assert.strictEqual(body.tableReference.tableId, TABLE_ID); done(); }; @@ -407,7 +410,7 @@ describe('BigQuery/Dataset', function() { it('should create a schema object from a string', function(done) { ds.request = function(reqOpts) { - assert.deepEqual(reqOpts.json.schema, SCHEMA_OBJECT); + assert.deepStrictEqual(reqOpts.json.schema, SCHEMA_OBJECT); done(); }; @@ -416,7 +419,10 @@ describe('BigQuery/Dataset', function() { it('should wrap an array schema', function(done) { ds.request = function(reqOpts) { - assert.deepEqual(reqOpts.json.schema.fields, SCHEMA_OBJECT.fields); + assert.deepStrictEqual( + reqOpts.json.schema.fields, + SCHEMA_OBJECT.fields + ); done(); }; @@ -530,9 +536,9 @@ describe('BigQuery/Dataset', function() { describe('delete', function() { it('should delete the dataset via the api', function(done) { ds.request = function(reqOpts) { - assert.equal(reqOpts.method, 'DELETE'); - assert.equal(reqOpts.uri, ''); - assert.deepEqual(reqOpts.qs, {deleteContents: false}); + assert.strictEqual(reqOpts.method, 'DELETE'); + assert.strictEqual(reqOpts.uri, ''); + assert.deepStrictEqual(reqOpts.qs, {deleteContents: false}); done(); }; @@ -541,7 +547,7 @@ describe('BigQuery/Dataset', function() { it('should allow a force delete', function(done) { ds.request = function(reqOpts) { - assert.deepEqual(reqOpts.qs, {deleteContents: true}); + assert.deepStrictEqual(reqOpts.qs, {deleteContents: true}); done(); }; @@ -586,8 +592,8 @@ describe('BigQuery/Dataset', function() { describe('getTables', function() { it('should get tables from the api', function(done) { ds.request = function(reqOpts) { - assert.equal(reqOpts.uri, '/tables'); - assert.deepEqual(reqOpts.qs, {}); + assert.strictEqual(reqOpts.uri, '/tables'); + assert.deepStrictEqual(reqOpts.qs, {}); done(); }; @@ -610,7 +616,7 @@ describe('BigQuery/Dataset', function() { it('should default the query value to an empty object', function(done) { ds.request = function(reqOpts) { - assert.deepEqual(reqOpts.qs, {}); + assert.deepStrictEqual(reqOpts.qs, {}); done(); }; @@ -689,7 +695,7 @@ describe('BigQuery/Dataset', function() { ds.getTables(query, function(err, tables, nextQuery) { assert.ifError(err); - assert.deepEqual(nextQuery, expectedNextQuery); + assert.deepStrictEqual(nextQuery, expectedNextQuery); done(); }); }); @@ -714,7 +720,7 @@ describe('BigQuery/Dataset', function() { var query = 'SELECT * FROM allthedata'; ds.bigQuery.query = function(opts) { - assert.equal(opts.query, query); + assert.strictEqual(opts.query, query); done(); }; @@ -723,8 +729,8 @@ describe('BigQuery/Dataset', function() { it('should pass along options', function(done) { ds.bigQuery.query = function(opts) { - assert.equal(opts.a, options.a); - assert.equal(opts.c, options.c); + assert.strictEqual(opts.a, options.a); + assert.strictEqual(opts.c, options.c); done(); }; @@ -733,7 +739,7 @@ describe('BigQuery/Dataset', function() { it('should extend options with defaultDataset', function(done) { ds.bigQuery.query = function(opts) { - assert.deepEqual(opts.defaultDataset, {datasetId: ds.id}); + assert.deepStrictEqual(opts.defaultDataset, {datasetId: ds.id}); done(); }; @@ -752,7 +758,7 @@ describe('BigQuery/Dataset', function() { it('should not modify original options object', function(done) { ds.bigQuery.query = function() { - assert.deepEqual(options, {a: 'b', c: 'd'}); + assert.deepStrictEqual(options, {a: 'b', c: 'd'}); done(); }; @@ -763,7 +769,7 @@ describe('BigQuery/Dataset', function() { var callback = util.noop; ds.bigQuery.query = function(opts, cb) { - assert.equal(cb, callback); + assert.strictEqual(cb, callback); done(); }; @@ -776,7 +782,7 @@ describe('BigQuery/Dataset', function() { var tableId = 'tableId'; var table = ds.table(tableId); assert(table instanceof Table); - assert.equal(table.id, tableId); + assert.strictEqual(table.id, tableId); }); it('should inherit the dataset location', function() { diff --git a/test/index.js b/test/index.js index 6404bc01..6c1376a3 100644 --- a/test/index.js +++ b/test/index.js @@ -43,7 +43,7 @@ var fakeUtil = extend({}, util, { } promisified = true; - assert.deepEqual(options.exclude, [ + assert.deepStrictEqual(options.exclude, [ 'dataset', 'date', 'datetime', @@ -85,8 +85,8 @@ var fakePaginator = { } methods = arrify(methods); - assert.equal(Class.name, 'BigQuery'); - assert.deepEqual(methods, ['getDatasets', 'getJobs']); + assert.strictEqual(Class.name, 'BigQuery'); + assert.deepStrictEqual(methods, ['getDatasets', 'getJobs']); extended = true; }, streamify: function(methodName) { @@ -173,10 +173,13 @@ describe('BigQuery', function() { var baseUrl = 'https://www.googleapis.com/bigquery/v2'; assert.strictEqual(calledWith.baseUrl, baseUrl); - assert.deepEqual(calledWith.scopes, [ + assert.deepStrictEqual(calledWith.scopes, [ 'https://www.googleapis.com/auth/bigquery', ]); - assert.deepEqual(calledWith.packageJson, require('../package.json')); + assert.deepStrictEqual( + calledWith.packageJson, + require('../package.json') + ); }); it('should capture any user specified location', function() { @@ -404,7 +407,7 @@ describe('BigQuery', function() { var mergedRows = BigQuery.mergeSchemaWithRows_(schemaObject, rawRows); mergedRows.forEach(function(mergedRow, index) { - assert.deepEqual(mergedRow, rows[index].expected); + assert.deepStrictEqual(mergedRow, rows[index].expected); }); }); }); @@ -592,7 +595,7 @@ describe('BigQuery', function() { it('should return correct type for an array', function() { var type = BigQuery.getType_([1]); - assert.deepEqual(type, { + assert.deepStrictEqual(type, { type: 'ARRAY', arrayType: { type: 'INT64', @@ -603,7 +606,7 @@ describe('BigQuery', function() { it('should return correct type for a struct', function() { var type = BigQuery.getType_({prop: 1}); - assert.deepEqual(type, { + assert.deepStrictEqual(type, { type: 'STRUCT', structTypes: [ { @@ -708,7 +711,7 @@ describe('BigQuery', function() { var queryParameter = BigQuery.valueToQueryParameter_(array); var arrayValues = queryParameter.parameterValue.arrayValues; - assert.deepEqual(arrayValues, [ + assert.deepStrictEqual(arrayValues, [ { value: array[0], }, @@ -750,7 +753,7 @@ describe('BigQuery', function() { }; }; - assert.deepEqual(BigQuery.valueToQueryParameter_(8), { + assert.deepStrictEqual(BigQuery.valueToQueryParameter_(8), { parameterType: { type: typeName, }, @@ -768,7 +771,7 @@ describe('BigQuery', function() { bq.request = function(reqOpts) { assert.strictEqual(reqOpts.method, 'POST'); assert.strictEqual(reqOpts.uri, '/datasets'); - assert.deepEqual(reqOpts.json.datasetReference, { + assert.deepStrictEqual(reqOpts.json.datasetReference, { datasetId: DATASET_ID, }); @@ -802,7 +805,7 @@ describe('BigQuery', function() { bq.request = function(reqOpts) { assert.notStrictEqual(reqOpts.json, options); - assert.deepEqual(options, originalOptions); + assert.deepStrictEqual(options, originalOptions); done(); }; @@ -817,7 +820,7 @@ describe('BigQuery', function() { }; bq.createDataset(DATASET_ID, function(err) { - assert.equal(err, error); + assert.strictEqual(err, error); done(); }); }); @@ -843,7 +846,7 @@ describe('BigQuery', function() { bq.createDataset(DATASET_ID, function(err, dataset, apiResponse) { assert.ifError(err); - assert.deepEqual(apiResponse, resp); + assert.deepStrictEqual(apiResponse, resp); done(); }); }); @@ -857,7 +860,7 @@ describe('BigQuery', function() { bq.createDataset(DATASET_ID, function(err, dataset) { assert.ifError(err); - assert.deepEqual(dataset.metadata, metadata); + assert.deepStrictEqual(dataset.metadata, metadata); done(); }); }); @@ -899,7 +902,7 @@ describe('BigQuery', function() { bq.request = function(reqOpts) { assert.strictEqual(reqOpts.method, 'POST'); assert.strictEqual(reqOpts.uri, '/jobs'); - assert.deepEqual(reqOpts.json, expectedOptions); + assert.deepStrictEqual(reqOpts.json, expectedOptions); assert.notStrictEqual(reqOpts.json, fakeOptions); done(); }; @@ -994,7 +997,7 @@ describe('BigQuery', function() { assert(err instanceof FakeApiError); var errorOpts = err.calledWith_[0]; - assert.deepEqual(errorOpts.errors, errors); + assert.deepStrictEqual(errorOpts.errors, errors); assert.strictEqual(errorOpts.response, response); done(); }); @@ -1059,11 +1062,14 @@ describe('BigQuery', function() { it('should assign destination table to request body', function(done) { bq.request = function(reqOpts) { - assert.deepEqual(reqOpts.json.configuration.query.destinationTable, { - datasetId: dataset.id, - projectId: dataset.bigQuery.projectId, - tableId: TABLE_ID, - }); + assert.deepStrictEqual( + reqOpts.json.configuration.query.destinationTable, + { + datasetId: dataset.id, + projectId: dataset.bigQuery.projectId, + tableId: TABLE_ID, + } + ); done(); }; @@ -1299,7 +1305,7 @@ describe('BigQuery', function() { var ds = bq.dataset(DATASET_ID, options); var args = ds.calledWith_; - assert.deepEqual(args[2], expectedOptions); + assert.deepStrictEqual(args[2], expectedOptions); assert.notStrictEqual(args[2], options); }); }); @@ -1308,7 +1314,7 @@ describe('BigQuery', function() { it('should get datasets from the api', function(done) { bq.request = function(reqOpts) { assert.strictEqual(reqOpts.uri, '/datasets'); - assert.deepEqual(reqOpts.qs, {}); + assert.deepStrictEqual(reqOpts.qs, {}); done(); }; @@ -1329,7 +1335,7 @@ describe('BigQuery', function() { it('should default the query to an empty object', function(done) { bq.request = function(reqOpts) { - assert.deepEqual(reqOpts.qs, {}); + assert.deepStrictEqual(reqOpts.qs, {}); done(); }; @@ -1372,7 +1378,7 @@ describe('BigQuery', function() { assert(dataset instanceof FakeDataset); assert.strictEqual(args[0], bq); assert.strictEqual(args[1], datasetId); - assert.deepEqual(args[2], {location: LOCATION}); + assert.deepStrictEqual(args[2], {location: LOCATION}); done(); }); }); @@ -1421,7 +1427,7 @@ describe('BigQuery', function() { }; bq.getDatasets(function(err, datasets, nextQuery) { - assert.deepEqual(nextQuery, { + assert.deepStrictEqual(nextQuery, { pageToken: token, }); done(); @@ -1451,7 +1457,7 @@ describe('BigQuery', function() { }; bq.request = function(reqOpts) { - assert.deepEqual(reqOpts.qs, queryObject); + assert.deepStrictEqual(reqOpts.qs, queryObject); done(); }; @@ -1460,7 +1466,7 @@ describe('BigQuery', function() { it('should default the query to an object', function(done) { bq.request = function(reqOpts) { - assert.deepEqual(reqOpts.qs, {}); + assert.deepStrictEqual(reqOpts.qs, {}); done(); }; @@ -1504,7 +1510,7 @@ describe('BigQuery', function() { assert(job instanceof FakeJob); assert.strictEqual(args[0], bq); assert.strictEqual(args[1], JOB_ID); - assert.deepEqual(args[2], {location: LOCATION}); + assert.deepStrictEqual(args[2], {location: LOCATION}); done(); }); }); @@ -1564,7 +1570,7 @@ describe('BigQuery', function() { bq.getJobs(function(err, jobs, nextQuery) { assert.ifError(err); - assert.deepEqual(nextQuery, { + assert.deepStrictEqual(nextQuery, { pageToken: token, }); done(); @@ -1605,7 +1611,7 @@ describe('BigQuery', function() { var job = bq.job(JOB_ID, options); var args = job.calledWith_; - assert.deepEqual(args[2], expectedOptions); + assert.deepStrictEqual(args[2], expectedOptions); assert.notStrictEqual(args[2], options); }); }); @@ -1643,7 +1649,7 @@ describe('BigQuery', function() { bq.query(options, function(err, rows, resp) { assert.ifError(err); - assert.deepEqual(rows, []); + assert.deepStrictEqual(rows, []); assert.strictEqual(resp, FAKE_RESPONSE); done(); }); @@ -1652,7 +1658,7 @@ describe('BigQuery', function() { it('should call job#getQueryResults', function(done) { var fakeJob = { getQueryResults: function(options, callback) { - assert.deepEqual(options, {}); + assert.deepStrictEqual(options, {}); callback(null, FAKE_ROWS, FAKE_RESPONSE); }, }; diff --git a/test/job.js b/test/job.js index 7e53ee3c..4f36783c 100644 --- a/test/job.js +++ b/test/job.js @@ -46,7 +46,7 @@ var fakePaginator = { } methods = arrify(methods); - assert.deepEqual(methods, ['getQueryResults']); + assert.deepStrictEqual(methods, ['getQueryResults']); extended = true; }, streamify: function(methodName) { @@ -98,7 +98,7 @@ describe('BigQuery/Job', function() { }); it('should assign this.bigQuery', function() { - assert.deepEqual(job.bigQuery, BIGQUERY); + assert.deepStrictEqual(job.bigQuery, BIGQUERY); }); it('should inherit from Operation', function() { @@ -109,7 +109,7 @@ describe('BigQuery/Job', function() { assert.strictEqual(calledWith.parent, BIGQUERY); assert.strictEqual(calledWith.baseUrl, '/jobs'); assert.strictEqual(calledWith.id, JOB_ID); - assert.deepEqual(calledWith.methods, { + assert.deepStrictEqual(calledWith.methods, { exists: true, get: true, setMetadata: true, @@ -132,7 +132,7 @@ describe('BigQuery/Job', function() { var job = new Job(BIGQUERY, JOB_ID, {location: LOCATION}); var calledWith = job.calledWith_[0]; - assert.deepEqual(calledWith.methods.getMetadata, { + assert.deepStrictEqual(calledWith.methods.getMetadata, { reqOpts: { qs: {location: LOCATION}, }, @@ -155,7 +155,7 @@ describe('BigQuery/Job', function() { var job = new Job(BIGQUERY, JOB_ID, {location: LOCATION}); job.request = function(reqOpts) { - assert.deepEqual(reqOpts.qs, {location: LOCATION}); + assert.deepStrictEqual(reqOpts.qs, {location: LOCATION}); done(); }; @@ -200,7 +200,7 @@ describe('BigQuery/Job', function() { var expectedOptions = extend({location: undefined}, options); BIGQUERY.request = function(reqOpts) { - assert.deepEqual(reqOpts.qs, expectedOptions); + assert.deepStrictEqual(reqOpts.qs, expectedOptions); done(); }; @@ -211,7 +211,7 @@ describe('BigQuery/Job', function() { var job = new Job(BIGQUERY, JOB_ID, {location: LOCATION}); BIGQUERY.request = function(reqOpts) { - assert.deepEqual(reqOpts.qs, {location: LOCATION}); + assert.deepStrictEqual(reqOpts.qs, {location: LOCATION}); done(); }; @@ -238,7 +238,7 @@ describe('BigQuery/Job', function() { it('should return the rows and response to the callback', function(done) { job.getQueryResults(function(err, rows, nextQuery, resp) { assert.ifError(err); - assert.deepEqual(rows, []); + assert.deepStrictEqual(rows, []); assert.strictEqual(resp, RESPONSE); done(); }); @@ -278,7 +278,7 @@ describe('BigQuery/Job', function() { job.getQueryResults(options, function(err, rows, nextQuery) { assert.ifError(err); - assert.deepEqual(nextQuery, options); + assert.deepStrictEqual(nextQuery, options); assert.notStrictEqual(nextQuery, options); done(); }); @@ -287,7 +287,7 @@ describe('BigQuery/Job', function() { it('should populate nextQuery when more results exist', function(done) { job.getQueryResults(options, function(err, rows, nextQuery) { assert.ifError(err); - assert.equal(nextQuery.pageToken, pageToken); + assert.strictEqual(nextQuery.pageToken, pageToken); done(); }); }); diff --git a/test/table.js b/test/table.js index ca012dfe..7f78924c 100644 --- a/test/table.js +++ b/test/table.js @@ -55,8 +55,8 @@ var fakePaginator = { } methods = arrify(methods); - assert.equal(Class.name, 'Table'); - assert.deepEqual(methods, ['getRows']); + assert.strictEqual(Class.name, 'Table'); + assert.deepStrictEqual(methods, ['getRows']); extended = true; }, streamify: function(methodName) { @@ -185,7 +185,7 @@ describe('BigQuery/Table', function() { assert.strictEqual(calledWith.parent, datasetInstance); assert.strictEqual(calledWith.baseUrl, '/tables'); assert.strictEqual(calledWith.id, TABLE_ID); - assert.deepEqual(calledWith.methods, { + assert.deepStrictEqual(calledWith.methods, { create: true, delete: true, exists: true, @@ -215,7 +215,7 @@ describe('BigQuery/Table', function() { }; var reqOpts = interceptor.request(fakeReqOpts); - assert.deepEqual(reqOpts.headers, {'If-Match': FAKE_ETAG}); + assert.deepStrictEqual(reqOpts.headers, {'If-Match': FAKE_ETAG}); }); it('should respect already existing headers', function() { @@ -236,7 +236,7 @@ describe('BigQuery/Table', function() { }); var reqOpts = interceptor.request(fakeReqOpts); - assert.deepEqual(reqOpts.headers, expectedHeaders); + assert.deepStrictEqual(reqOpts.headers, expectedHeaders); }); it('should not apply the header if method is not patch', function() { @@ -250,14 +250,14 @@ describe('BigQuery/Table', function() { }; var reqOpts = interceptor.request(fakeReqOpts); - assert.deepEqual(reqOpts.headers, undefined); + assert.deepStrictEqual(reqOpts.headers, undefined); }); }); }); describe('createSchemaFromString_', function() { it('should create a schema object from a string', function() { - assert.deepEqual( + assert.deepStrictEqual( Table.createSchemaFromString_(SCHEMA_STRING), SCHEMA_OBJECT ); @@ -309,7 +309,7 @@ describe('BigQuery/Table', function() { var array = [buffer, date]; - assert.deepEqual(Table.encodeValue_(array), [ + assert.deepStrictEqual(Table.encodeValue_(array), [ buffer.toString('base64'), date.toJSON(), ]); @@ -325,7 +325,7 @@ describe('BigQuery/Table', function() { }, }; - assert.deepEqual(Table.encodeValue_(object), { + assert.deepStrictEqual(Table.encodeValue_(object), { nested: { array: [buffer.toString('base64'), date.toJSON()], }, @@ -356,7 +356,7 @@ describe('BigQuery/Table', function() { var formatted = Table.formatMetadata_(metadata); - assert.deepEqual(metadata, formatted); + assert.deepStrictEqual(metadata, formatted); assert.notStrictEqual(metadata, formatted); }); @@ -387,7 +387,7 @@ describe('BigQuery/Table', function() { var formatted = Table.formatMetadata_({schema: fields}); - assert.deepEqual(formatted.schema.fields, fields); + assert.deepStrictEqual(formatted.schema.fields, fields); }); it('should format the schema fields option', function() { @@ -400,7 +400,7 @@ describe('BigQuery/Table', function() { var expectedFields = ['a', {fields: [], type: 'RECORD'}, 'b']; var formatted = Table.formatMetadata_(metadata); - assert.deepEqual(formatted.schema.fields, expectedFields); + assert.deepStrictEqual(formatted.schema.fields, expectedFields); }); it('should format the time partitioning option', function() { @@ -444,7 +444,7 @@ describe('BigQuery/Table', function() { it('should optionally accept metadata', function(done) { table.createCopyJob = function(destination, metadata) { - assert.deepEqual(metadata, {}); + assert.deepStrictEqual(metadata, {}); done(); }; @@ -515,7 +515,7 @@ describe('BigQuery/Table', function() { it('should optionally accept metadata', function(done) { table.createCopyFromJob = function(sourceTables, metadata) { - assert.deepEqual(metadata, {}); + assert.deepStrictEqual(metadata, {}); done(); }; @@ -584,7 +584,7 @@ describe('BigQuery/Table', function() { it('should send correct request to the API', function(done) { table.bigQuery.createJob = function(reqOpts) { - assert.deepEqual(reqOpts, { + assert.deepStrictEqual(reqOpts, { configuration: { copy: { a: 'b', @@ -693,7 +693,7 @@ describe('BigQuery/Table', function() { it('should send correct request to the API', function(done) { table.bigQuery.createJob = function(reqOpts) { - assert.deepEqual(reqOpts, { + assert.deepStrictEqual(reqOpts, { configuration: { copy: { a: 'b', @@ -722,7 +722,7 @@ describe('BigQuery/Table', function() { it('should accept multiple source tables', function(done) { table.bigQuery.createJob = function(reqOpts) { - assert.deepEqual(reqOpts.configuration.copy.sourceTables, [ + assert.deepStrictEqual(reqOpts.configuration.copy.sourceTables, [ { datasetId: SOURCE_TABLE.dataset.id, projectId: SOURCE_TABLE.bigQuery.projectId, @@ -820,7 +820,7 @@ describe('BigQuery/Table', function() { it('should call createJob correctly', function(done) { table.bigQuery.createJob = function(reqOpts) { - assert.deepEqual(reqOpts.configuration.extract.sourceTable, { + assert.deepStrictEqual(reqOpts.configuration.extract.sourceTable, { datasetId: table.dataset.id, projectId: table.bigQuery.projectId, tableId: table.id, @@ -844,7 +844,7 @@ describe('BigQuery/Table', function() { it('should accept csv', function(done) { table.bigQuery.createJob = function(reqOpts) { var extract = reqOpts.configuration.extract; - assert.equal(extract.destinationFormat, 'CSV'); + assert.strictEqual(extract.destinationFormat, 'CSV'); done(); }; @@ -854,7 +854,10 @@ describe('BigQuery/Table', function() { it('should accept json', function(done) { table.bigQuery.createJob = function(reqOpts) { var extract = reqOpts.configuration.extract; - assert.equal(extract.destinationFormat, 'NEWLINE_DELIMITED_JSON'); + assert.strictEqual( + extract.destinationFormat, + 'NEWLINE_DELIMITED_JSON' + ); done(); }; @@ -864,7 +867,7 @@ describe('BigQuery/Table', function() { it('should accept avro', function(done) { table.bigQuery.createJob = function(reqOpts) { var extract = reqOpts.configuration.extract; - assert.equal(extract.destinationFormat, 'AVRO'); + assert.strictEqual(extract.destinationFormat, 'AVRO'); done(); }; @@ -874,7 +877,7 @@ describe('BigQuery/Table', function() { it('should accept parquet', function(done) { table.bigQuery.createJob = function(reqOpts) { var extract = reqOpts.configuration.extract; - assert.equal(extract.destinationFormat, 'PARQUET'); + assert.strictEqual(extract.destinationFormat, 'PARQUET'); done(); }; @@ -884,7 +887,7 @@ describe('BigQuery/Table', function() { it('should parse out full gs:// urls from files', function(done) { table.bigQuery.createJob = function(reqOpts) { - assert.deepEqual(reqOpts.configuration.extract.destinationUris, [ + assert.deepStrictEqual(reqOpts.configuration.extract.destinationUris, [ 'gs://' + FILE.bucket.name + '/' + FILE.name, ]); done(); @@ -921,7 +924,7 @@ describe('BigQuery/Table', function() { it('should detect file format if a format is not provided', function(done) { table.bigQuery.createJob = function(reqOpts) { var destFormat = reqOpts.configuration.extract.destinationFormat; - assert.equal(destFormat, 'NEWLINE_DELIMITED_JSON'); + assert.strictEqual(destFormat, 'NEWLINE_DELIMITED_JSON'); done(); }; @@ -931,7 +934,7 @@ describe('BigQuery/Table', function() { it('should assign the provided format if matched', function(done) { table.bigQuery.createJob = function(reqOpts) { var extract = reqOpts.configuration.extract; - assert.equal(extract.destinationFormat, 'CSV'); + assert.strictEqual(extract.destinationFormat, 'CSV'); assert.strictEqual(extract.format, undefined); done(); }; @@ -947,7 +950,7 @@ describe('BigQuery/Table', function() { it('should assign GZIP compression with gzip: true', function(done) { table.bigQuery.createJob = function(reqOpts) { - assert.equal(reqOpts.configuration.extract.compression, 'GZIP'); + assert.strictEqual(reqOpts.configuration.extract.compression, 'GZIP'); assert.strictEqual(reqOpts.configuration.extract.gzip, undefined); done(); }; @@ -1061,7 +1064,7 @@ describe('BigQuery/Table', function() { it('should infer the file format from the given filepath', function(done) { table.createWriteStream = function(metadata) { - assert.equal(metadata.sourceFormat, 'NEWLINE_DELIMITED_JSON'); + assert.strictEqual(metadata.sourceFormat, 'NEWLINE_DELIMITED_JSON'); var ws = new stream.Writable(); setImmediate(function() { ws.emit('complete', JOB); @@ -1077,7 +1080,7 @@ describe('BigQuery/Table', function() { var error = new Error('Error.'); table.createWriteStream = function(metadata) { - assert.equal(metadata.sourceFormat, 'NEWLINE_DELIMITED_JSON'); + assert.strictEqual(metadata.sourceFormat, 'NEWLINE_DELIMITED_JSON'); var ws = new stream.Writable(); setImmediate(function() { ws.emit('error', error); @@ -1094,7 +1097,7 @@ describe('BigQuery/Table', function() { it('should not infer the file format if one is given', function(done) { table.createWriteStream = function(metadata) { - assert.equal(metadata.sourceFormat, 'CSV'); + assert.strictEqual(metadata.sourceFormat, 'CSV'); var ws = new stream.Writable(); setImmediate(function() { ws.emit('complete', JOB); @@ -1130,7 +1133,10 @@ describe('BigQuery/Table', function() { it('should convert File objects to gs:// urls', function(done) { table.bigQuery.createJob = function(reqOpts) { var sourceUri = reqOpts.configuration.load.sourceUris[0]; - assert.equal(sourceUri, 'gs://' + FILE.bucket.name + '/' + FILE.name); + assert.strictEqual( + sourceUri, + 'gs://' + FILE.bucket.name + '/' + FILE.name + ); done(); }; @@ -1140,7 +1146,7 @@ describe('BigQuery/Table', function() { it('should infer the file format from a File object', function(done) { table.bigQuery.createJob = function(reqOpts) { var sourceFormat = reqOpts.configuration.load.sourceFormat; - assert.equal(sourceFormat, 'NEWLINE_DELIMITED_JSON'); + assert.strictEqual(sourceFormat, 'NEWLINE_DELIMITED_JSON'); done(); }; @@ -1150,7 +1156,7 @@ describe('BigQuery/Table', function() { it('should not override a provided format with a File', function(done) { table.bigQuery.createJob = function(reqOpts) { var sourceFormat = reqOpts.configuration.load.sourceFormat; - assert.equal(sourceFormat, 'NEWLINE_DELIMITED_JSON'); + assert.strictEqual(sourceFormat, 'NEWLINE_DELIMITED_JSON'); done(); }; @@ -1275,7 +1281,7 @@ describe('BigQuery/Table', function() { describe('createQueryStream', function() { it('should call datasetInstance.createQueryStream()', function(done) { table.dataset.createQueryStream = function(a) { - assert.equal(a, 'a'); + assert.strictEqual(a, 'a'); done(); }; @@ -1300,7 +1306,7 @@ describe('BigQuery/Table', function() { it('should accept csv', function(done) { makeWritableStreamOverride = function(stream, options) { var load = options.metadata.configuration.load; - assert.equal(load.sourceFormat, 'CSV'); + assert.strictEqual(load.sourceFormat, 'CSV'); done(); }; @@ -1310,7 +1316,7 @@ describe('BigQuery/Table', function() { it('should accept json', function(done) { makeWritableStreamOverride = function(stream, options) { var load = options.metadata.configuration.load; - assert.equal(load.sourceFormat, 'NEWLINE_DELIMITED_JSON'); + assert.strictEqual(load.sourceFormat, 'NEWLINE_DELIMITED_JSON'); done(); }; @@ -1320,7 +1326,7 @@ describe('BigQuery/Table', function() { it('should accept avro', function(done) { makeWritableStreamOverride = function(stream, options) { var load = options.metadata.configuration.load; - assert.equal(load.sourceFormat, 'AVRO'); + assert.strictEqual(load.sourceFormat, 'AVRO'); done(); }; @@ -1338,7 +1344,7 @@ describe('BigQuery/Table', function() { makeWritableStreamOverride = function(stream, options) { var load = options.metadata.configuration.load; - assert.deepEqual(load.schema, expectedSchema); + assert.deepStrictEqual(load.schema, expectedSchema); done(); }; @@ -1381,7 +1387,7 @@ describe('BigQuery/Table', function() { var stream; makeWritableStreamOverride = function(s) { - assert.equal(s, stream); + assert.strictEqual(s, stream); done(); }; @@ -1391,7 +1397,7 @@ describe('BigQuery/Table', function() { it('should pass the connection', function(done) { makeWritableStreamOverride = function(stream, options) { - assert.deepEqual(options.connection, table.connection); + assert.deepStrictEqual(options.connection, table.connection); done(); }; @@ -1400,7 +1406,7 @@ describe('BigQuery/Table', function() { it('should pass extended metadata', function(done) { makeWritableStreamOverride = function(stream, options) { - assert.deepEqual(options.metadata, { + assert.deepStrictEqual(options.metadata, { configuration: { load: { a: 'b', @@ -1430,7 +1436,7 @@ describe('BigQuery/Table', function() { 'https://www.googleapis.com/upload/bigquery/v2/projects/' + table.bigQuery.projectId + '/jobs'; - assert.equal(options.request.uri, uri); + assert.strictEqual(options.request.uri, uri); done(); }; @@ -1504,8 +1510,8 @@ describe('BigQuery/Table', function() { table .createWriteStream() .on('complete', function(job) { - assert.equal(job.id, jobId); - assert.deepEqual(job.metadata, metadata); + assert.strictEqual(job.id, jobId); + assert.deepStrictEqual(job.metadata, metadata); done(); }) .emit('writing'); @@ -1538,7 +1544,7 @@ describe('BigQuery/Table', function() { it('should optionally accept metadata', function(done) { table.createExtractJob = function(destination, metadata) { - assert.deepEqual(metadata, {}); + assert.deepStrictEqual(metadata, {}); done(); }; @@ -1718,7 +1724,7 @@ describe('BigQuery/Table', function() { table.getRows(function(err, rows, nextQuery, apiResponse) { assert.ifError(err); - assert.deepEqual(apiResponse, {rows: [{f: [{v: 'stephen'}]}]}); + assert.deepStrictEqual(apiResponse, {rows: [{f: [{v: 'stephen'}]}]}); done(); }); }); @@ -1736,9 +1742,13 @@ describe('BigQuery/Table', function() { table.getRows(options, function(err, rows, nextQuery) { assert.ifError(err); - assert.deepEqual(nextQuery, {a: 'b', c: 'd', pageToken: pageToken}); + assert.deepStrictEqual(nextQuery, { + a: 'b', + c: 'd', + pageToken: pageToken, + }); // Original object isn't affected. - assert.deepEqual(options, {a: 'b', c: 'd'}); + assert.deepStrictEqual(options, {a: 'b', c: 'd'}); done(); }); }); @@ -1786,9 +1796,9 @@ describe('BigQuery/Table', function() { it('should save data', function(done) { table.request = function(reqOpts) { - assert.equal(reqOpts.method, 'POST'); - assert.equal(reqOpts.uri, '/insertAll'); - assert.deepEqual(reqOpts.json, dataApiFormat); + assert.strictEqual(reqOpts.method, 'POST'); + assert.strictEqual(reqOpts.uri, '/insertAll'); + assert.deepStrictEqual(reqOpts.json, dataApiFormat); done(); }; @@ -1849,7 +1859,7 @@ describe('BigQuery/Table', function() { table.insert(data, function(err) { assert.strictEqual(err.name, 'PartialFailureError'); - assert.deepEqual(err.errors, [ + assert.deepStrictEqual(err.errors, [ { row: dataApiFormat.rows[0].json, errors: [row0Error], @@ -1866,9 +1876,9 @@ describe('BigQuery/Table', function() { it('should insert raw data', function(done) { table.request = function(reqOpts) { - assert.equal(reqOpts.method, 'POST'); - assert.equal(reqOpts.uri, '/insertAll'); - assert.deepEqual(reqOpts.json, {rows: rawData}); + assert.strictEqual(reqOpts.method, 'POST'); + assert.strictEqual(reqOpts.uri, '/insertAll'); + assert.deepStrictEqual(reqOpts.json, {rows: rawData}); assert.strictEqual(reqOpts.json.raw, undefined); done(); }; @@ -1885,8 +1895,8 @@ describe('BigQuery/Table', function() { }; table.request = function(reqOpts) { - assert.equal(reqOpts.method, 'POST'); - assert.equal(reqOpts.uri, '/insertAll'); + assert.strictEqual(reqOpts.method, 'POST'); + assert.strictEqual(reqOpts.uri, '/insertAll'); assert.strictEqual( reqOpts.json.ignoreUnknownValues, @@ -1895,7 +1905,7 @@ describe('BigQuery/Table', function() { assert.strictEqual(reqOpts.json.skipInvalidRows, opts.skipInvalidRows); assert.strictEqual(reqOpts.json.templateSuffix, opts.templateSuffix); - assert.deepEqual(reqOpts.json.rows, dataApiFormat.rows); + assert.deepStrictEqual(reqOpts.json.rows, dataApiFormat.rows); done(); }; @@ -2016,9 +2026,9 @@ describe('BigQuery/Table', function() { var attempts = 0; table.request = function(reqOpts, callback) { - assert.equal(reqOpts.method, 'POST'); - assert.equal(reqOpts.uri, '/insertAll'); - assert.deepEqual(reqOpts.json, dataApiFormat); + assert.strictEqual(reqOpts.method, 'POST'); + assert.strictEqual(reqOpts.uri, '/insertAll'); + assert.deepStrictEqual(reqOpts.json, dataApiFormat); if (++attempts === 2) { callback(null, response); @@ -2062,7 +2072,7 @@ describe('BigQuery/Table', function() { it('should optionally accept metadata', function(done) { table.createLoadJob = function(source, metadata) { - assert.deepEqual(metadata, {}); + assert.deepStrictEqual(metadata, {}); done(); }; @@ -2111,8 +2121,8 @@ describe('BigQuery/Table', function() { describe('query', function() { it('should pass args through to datasetInstance.query()', function(done) { table.dataset.query = function(a, b) { - assert.equal(a, 'a'); - assert.equal(b, 'b'); + assert.strictEqual(a, 'a'); + assert.strictEqual(b, 'b'); done(); };