Skip to content

Commit 6baf6aa

Browse files
authored
Use a real Error in tests. (#192)
1 parent 256facd commit 6baf6aa

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

handwritten/bigquery/samples/test/queries.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ describe('bigquery:query', function () {
8585
});
8686

8787
it('should handle error', function () {
88-
var error = Error('syncQueryError');
88+
var error = new Error('error');
8989
var example = getSample();
9090
example.mocks.bigquery.query = sinon.stub().callsArgWith(1, error);
9191
example.program.syncQuery(query, function (err, data) {
@@ -121,7 +121,7 @@ describe('bigquery:query', function () {
121121
});
122122

123123
it('should handle error', function () {
124-
var error = Error('asyncQueryError');
124+
var error = new Error('error');
125125
var example = getSample();
126126
example.mocks.bigquery.startQuery = sinon.stub().callsArgWith(1, error);
127127
example.program.asyncQuery(query, function (err, job) {
@@ -193,7 +193,7 @@ describe('bigquery:query', function () {
193193
});
194194

195195
it('should handle error', function () {
196-
var error = Error('asyncPollError');
196+
var error = new Error('error');
197197
var example = getSample();
198198
example.mocks.job.getQueryResults = sinon.stub().callsArgWith(0, error);
199199
example.program.asyncPoll(example.jobId, function (err, rows) {

handwritten/bigquery/samples/test/tables.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ describe('bigquery:tables', function () {
278278
});
279279

280280
it('should handle export error', function () {
281-
var error = new Error('exportTableToGCSError');
281+
var error = new Error('error');
282282
var example = getSample();
283283
var callback = sinon.stub();
284284
example.mocks.table.export.yields(error);

0 commit comments

Comments
 (0)