Skip to content

Commit

Permalink
proxy typings ask for object instead of string (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann authored Sep 1, 2020
1 parent 97b3638 commit a7c4c02
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`<br>
Type: `string`<br>
Default: `null`

## Usage
Expand Down
4 changes: 2 additions & 2 deletions scripts/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = `
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/typings/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const api = new SauceLabs({
region: 'eu',
user: 'foo',
key: 'foobar',
proxy: {},
proxy: 'barfoo',
headless: false
});

Expand Down

0 comments on commit a7c4c02

Please sign in to comment.