Commit 69c2977 1 parent fe7b129 commit 69c2977 Copy full SHA for 69c2977
File tree 2 files changed +35
-1
lines changed
2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,9 @@ module.exports = figgyPudding({
75
75
'scope' : { } ,
76
76
'spec' : { } ,
77
77
'strict-ssl' : { } ,
78
- 'timeout' : { } ,
78
+ 'timeout' : {
79
+ default : 30 * 1000
80
+ } ,
79
81
'user-agent' : {
80
82
default : `${
81
83
pkg . name
Original file line number Diff line number Diff line change
1
+ 'use strict'
2
+
3
+ const config = require ( '../config.js' )
4
+ const npmlog = require ( 'npmlog' )
5
+ const { test } = require ( 'tap' )
6
+
7
+ npmlog . level = process . env . LOGLEVEL || 'silent'
8
+
9
+ test ( 'isFromCI config option' , t => {
10
+ const CI = process . env . CI
11
+ process . env . CI = false
12
+ t . teardown ( t => {
13
+ process . env . CI = CI
14
+ } )
15
+ const OPTS = config ( {
16
+ log : npmlog ,
17
+ timeout : 0 ,
18
+ registry : 'https://mock.reg/'
19
+ } )
20
+ t . notOk ( OPTS . isFromCI , 'should be false if not on a CI env' )
21
+ t . end ( )
22
+ } )
23
+
24
+ test ( 'default timeout' , t => {
25
+ const DEFAULT_OPTS = config ( { } )
26
+ t . equal ( DEFAULT_OPTS . timeout , 30 * 1000 , 'default timeout is 30s' )
27
+ const SPECIFIED_OPTS = config ( {
28
+ timeout : 15 * 1000
29
+ } )
30
+ t . equal ( SPECIFIED_OPTS . timeout , 15 * 1000 , 'default timeout can be overridden' )
31
+ t . end ( )
32
+ } )
You can’t perform that action at this time.
0 commit comments