Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/bigquery/system-test/bigquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,17 @@ describe('BigQuery', function() {
});
});

it('should import data from a file via promises', function() {
return table.import(file)
.then(function(results) {
return results[0].promise();
})

This comment was marked as spam.

This comment was marked as spam.

.then(function(results) {
var metadata = results[0];
assert.strictEqual(metadata.status.state, 'DONE');
});
});

it('should convert values to their schema types', function(done) {
var data = {
name: 'dave',
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ function promisifyAll(Class, options) {
.keys(Class.prototype)
.filter(function(methodName) {
return is.fn(Class.prototype[methodName]) && // is it a function?
!/(^\_|(Stream|\_)$)/.test(methodName) && // is it public/non-stream?
!/(^\_|(Stream|\_)|promise$)/.test(methodName) && // is it promisable?
exclude.indexOf(methodName) === -1; // is it blacklisted?
});

Expand Down
2 changes: 2 additions & 0 deletions packages/common/test/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -1407,6 +1407,7 @@ describe('common/util', function() {
FakeClass.prototype.method_ = util.noop;
FakeClass.prototype._method = util.noop;
FakeClass.prototype.methodStream = util.noop;
FakeClass.prototype.promise = util.noop;

util.promisifyAll(FakeClass);
instance = new FakeClass();
Expand All @@ -1420,6 +1421,7 @@ describe('common/util', function() {
assert.strictEqual(FakeClass.prototype.method_, util.noop);
assert.strictEqual(FakeClass.prototype._method, util.noop);
assert.strictEqual(FakeClass.prototype.methodStream, util.noop);
assert.strictEqual(FakeClass.prototype.promise, util.noop);
});

it('should optionally except an exclude list', function() {
Expand Down