Commit b62c9fe0 by Daniel Cadenas

Make linter happy

parent 8e759b9e
...@@ -59,11 +59,7 @@ ClearbitClient.prototype.request = function (options) { ...@@ -59,11 +59,7 @@ ClearbitClient.prototype.request = function (options) {
method: 'get' method: 'get'
}); });
if (options.timeout) { var timeout = options.timeout || options.stream && 60000 || 10000;
var timeout = options.timeout;
} else {
var timeout = options.stream ? 60000 : 10000;
}
return needle.requestAsync( return needle.requestAsync(
options.method, options.method,
......
...@@ -105,8 +105,8 @@ describe('Client', function () { ...@@ -105,8 +105,8 @@ describe('Client', function () {
return client return client
.request(clientRequestOptions) .request(clientRequestOptions)
.then(() => needle.request.firstCall.args[3]) .then(function() { return needle.request.firstCall.args[3]; })
.finally(() => needle.request.restore()); .finally(function() { return needle.request.restore(); });
} }
it('can specify a custom timeout for a request', function () { it('can specify a custom timeout for a request', function () {
...@@ -114,14 +114,14 @@ describe('Client', function () { ...@@ -114,14 +114,14 @@ describe('Client', function () {
api: 'person', api: 'person',
timeout: 30000 timeout: 30000
}) })
.then((needleOptions) => { .then(function(needleOptions) {
expect(needleOptions).to.have.property('timeout', 30000); expect(needleOptions).to.have.property('timeout', 30000);
}); });
}); });
it('sets the default timeout to 10 seconds', function () { it('sets the default timeout to 10 seconds', function () {
return requestWithOptions({ api: 'person' }) return requestWithOptions({ api: 'person' })
.then((needleOptions) => { .then(function(needleOptions) {
expect(needleOptions).to.have.property('timeout', 10000); expect(needleOptions).to.have.property('timeout', 10000);
}); });
}); });
...@@ -132,7 +132,7 @@ describe('Client', function () { ...@@ -132,7 +132,7 @@ describe('Client', function () {
api: 'person', api: 'person',
stream: true stream: true
}) })
.then((needleOptions) => { .then(function(needleOptions) {
expect(needleOptions).to.have.property('timeout', 60000); expect(needleOptions).to.have.property('timeout', 60000);
}); });
}); });
...@@ -143,7 +143,7 @@ describe('Client', function () { ...@@ -143,7 +143,7 @@ describe('Client', function () {
stream: true, stream: true,
timeout: 30000 timeout: 30000
}) })
.then((needleOptions) => { .then(function(needleOptions) {
expect(needleOptions).to.have.property('timeout', 30000); expect(needleOptions).to.have.property('timeout', 30000);
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment