From 285415ecb3ea24fba9ab8d513dd84d66c4b7f333 Mon Sep 17 00:00:00 2001 From: jwngr Date: Mon, 13 Apr 2015 12:23:02 -0700 Subject: [PATCH] Added test for table.import() callback invocation --- test/bigquery/table.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/bigquery/table.js b/test/bigquery/table.js index 30535c86979..ab074b8f257 100644 --- a/test/bigquery/table.js +++ b/test/bigquery/table.js @@ -698,16 +698,22 @@ describe('BigQuery/Table', function() { }, 'file.json'); it('should accept just a File and a callback', function(done) { + var mockJob = { id: 'foo' }; + table.createWriteStream = function() { var ws = new stream.Writable(); setImmediate(function() { - ws.emit('complete'); + ws.emit('complete', mockJob); ws.end(); }); return ws; }; - table.import(FILEPATH, done); + table.import(FILEPATH, function(error, job) { + assert.strictEqual(error, null); + assert.deepEqual(job, mockJob); + done(); + }); }); it('should return a stream when a string is given', function() {