Skip to content

Commit

Permalink
fix: use 30s default for timeout as per README
Browse files Browse the repository at this point in the history
PR-URL: #20
Credit: @h4l
Close: #20
Reviewed-by: @isaacs
  • Loading branch information
h4l authored and isaacs committed Feb 13, 2020
1 parent 42f998a commit 50e8afc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ module.exports = figgyPudding({
scope: {},
spec: {},
'strict-ssl': {},
timeout: {},
timeout: {
default: 30 * 1000
},
'user-agent': {
default: `${
pkg.name
Expand Down
10 changes: 10 additions & 0 deletions test/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,13 @@ test('isFromCI config option', t => {
t.notOk(OPTS.isFromCI, 'should be false if not on a CI env')
t.end()
})

test('default timeout', t => {
const DEFAULT_OPTS = config({})
t.equal(DEFAULT_OPTS.timeout, 30 * 1000, 'default timeout is 30s')
const SPECIFIED_OPTS = config({
timeout: 15 * 1000
})
t.equal(SPECIFIED_OPTS.timeout, 15 * 1000, 'default timeout can be overridden')
t.end()
})

0 comments on commit 50e8afc

Please sign in to comment.