Skip to content

Commit 51316e8

Browse files
authored
refactor!: Remove options.ts (#1920)
* refactor!: Remove `options.ts` * chore: clean-up * test: remove unnecessary test
1 parent 654753d commit 51316e8

File tree

3 files changed

+0
-45
lines changed

3 files changed

+0
-45
lines changed

src/options.ts

-32
This file was deleted.

src/transporters.ts

-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ import {
1919
GaxiosPromise,
2020
GaxiosResponse,
2121
} from 'gaxios';
22-
import {validate} from './options';
2322

24-
// eslint-disable-next-line @typescript-eslint/no-var-requires
2523
const pkg = require('../../package.json');
2624

2725
const PRODUCT_NAME = 'google-api-nodejs-client';
@@ -85,7 +83,6 @@ export class DefaultTransporter implements Transporter {
8583
request<T>(opts: GaxiosOptions): GaxiosPromise<T> {
8684
// ensure the user isn't passing in request-style options
8785
opts = this.configure(opts);
88-
validate(opts);
8986
return this.instance.request<T>(opts).catch(e => {
9087
throw this.processError(e);
9188
});

test/test.transporters.ts

-10
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,6 @@ describe('transporters', () => {
121121
);
122122
});
123123

124-
it('should return an error if you try to use request config options with a promise', async () => {
125-
const expected = new RegExp(
126-
"'uri' is not a valid configuration option. Please use 'url' instead. This " +
127-
'library is using Axios for requests. Please see https://github.com/axios/axios ' +
128-
'to learn more about the valid request options.'
129-
);
130-
const uri = 'http://example.com/api';
131-
assert.throws(() => transporter.request({uri} as GaxiosOptions), expected);
132-
});
133-
134124
it('should support invocation with async/await', async () => {
135125
const url = 'http://example.com';
136126
const scope = nock(url).get('/').reply(200);

0 commit comments

Comments
 (0)