diff --git a/src/bigquery.ts b/src/bigquery.ts index f232fb52..2c5804af 100644 --- a/src/bigquery.ts +++ b/src/bigquery.ts @@ -326,6 +326,8 @@ export class BigQuery extends Service { baseUrl, scopes: ['https://www.googleapis.com/auth/bigquery'], packageJson: require('../../package.json'), + autoRetry: options.autoRetry, + maxRetries: options.maxRetries, }; if (options.scopes) { diff --git a/test/bigquery.ts b/test/bigquery.ts index 2432d37a..78aeaf32 100644 --- a/test/bigquery.ts +++ b/test/bigquery.ts @@ -273,6 +273,26 @@ describe('BigQuery', () => { assert.deepStrictEqual(calledWith.scopes, expectedScopes); }); + it('should pass autoRetry from options', () => { + const retry = false; + const bq = new BigQuery({ + autoRetry: retry, + }); + + const calledWith = bq.calledWith_[0]; + assert.deepStrictEqual(calledWith.autoRetry, retry); + }); + + it('should pass maxRetries from options', () => { + const retryVal = 1; + const bq = new BigQuery({ + maxRetries: retryVal, + }); + + const calledWith = bq.calledWith_[0]; + assert.deepStrictEqual(calledWith.maxRetries, retryVal); + }); + it('should not modify options argument', () => { const options = { projectId: PROJECT_ID,