diff --git a/README.md b/README.md index 8da7f0f8..a4517149 100644 --- a/README.md +++ b/README.md @@ -50,9 +50,9 @@ Default: `false` ### proxy -If you want to tunnel your API request through a proxy please see the [got proxy docs](https://github.com/sindresorhus/got/blob/master/readme.md#proxies) for more information. +If you want to tunnel your API request through a proxy please provide your proxy URL. -Type: `object`
+Type: `string`
Default: `null` ## Usage diff --git a/scripts/constants.js b/scripts/constants.js index 90310416..eb1dd538 100644 --- a/scripts/constants.js +++ b/scripts/constants.js @@ -28,9 +28,9 @@ export interface SauceLabsOptions { */ headless?: boolean; /** - * If you want to tunnel your API request through a proxy please see the [got proxy docs](https://github.com/sindresorhus/got/blob/master/readme.md#proxies) for more information. + * If you want to tunnel your API request through a proxy please provide your proxy URL. */ - proxy?: object; + proxy?: string; }` exports.TC_SAUCE_CONNECT_OBJ = ` diff --git a/src/index.js b/src/index.js index 739f455a..26a677a2 100644 --- a/src/index.js +++ b/src/index.js @@ -31,7 +31,7 @@ export default class SauceLabs { followRedirect: true, }) - if (this._options.proxy !== undefined) { + if (typeof this._options.proxy === 'string') { var proxyAgent = createProxyAgent(this._options.proxy) this._api = got.extend({ agent: proxyAgent diff --git a/tests/typings/test.ts b/tests/typings/test.ts index 0ddbbab7..2a7e660c 100644 --- a/tests/typings/test.ts +++ b/tests/typings/test.ts @@ -4,7 +4,7 @@ const api = new SauceLabs({ region: 'eu', user: 'foo', key: 'foobar', - proxy: {}, + proxy: 'barfoo', headless: false });