@@ -19,6 +19,9 @@ const EXEC_OPTS = { cwd: testDir }
19
19
const PKG = {
20
20
name : 'top' ,
21
21
version : '1.2.3' ,
22
+ scripts : {
23
+ install : 'node -p process.env.npm_config_foo'
24
+ } ,
22
25
dependencies : {
23
26
optimist : '0.6.0' ,
24
27
clean : '2.1.6'
@@ -77,6 +80,7 @@ test('basic installation', (t) => {
77
80
. then ( ( ) => fixture . create ( testDir ) )
78
81
. then ( ( ) => common . npm ( [
79
82
'ci' ,
83
+ '--foo=asdf' ,
80
84
'--registry' , common . registry ,
81
85
'--loglevel' , 'warn'
82
86
] , EXEC_OPTS ) )
@@ -88,7 +92,7 @@ test('basic installation', (t) => {
88
92
t . equal ( stderr . trim ( ) , '' , 'no output on stderr' )
89
93
t . match (
90
94
stdout . trim ( ) ,
91
- / ^ a d d e d 6 p a c k a g e s i n \d + (?: \. \d + ) ? s $ / ,
95
+ / \n a s d f \n a d d e d 6 p a c k a g e s i n \d + (?: \. \d + ) ? s $ / ,
92
96
'no warnings on stderr, and final output has right number of packages'
93
97
)
94
98
return fs . readdirAsync ( path . join ( testDir , 'node_modules' ) )
@@ -144,6 +148,7 @@ test('supports npm-shrinkwrap.json as well', (t) => {
144
148
. then ( ( ) => fixture . create ( testDir ) )
145
149
. then ( ( ) => common . npm ( [
146
150
'ci' ,
151
+ '--foo=asdf' ,
147
152
'--registry' , common . registry ,
148
153
'--loglevel' , 'warn'
149
154
] , EXEC_OPTS ) )
@@ -155,7 +160,7 @@ test('supports npm-shrinkwrap.json as well', (t) => {
155
160
t . equal ( stderr . trim ( ) , '' , 'no output on stderr' )
156
161
t . match (
157
162
stdout . trim ( ) ,
158
- / ^ a d d e d 6 p a c k a g e s i n \d + (?: \. \d + ) ? s $ / ,
163
+ / \n a s d f \n a d d e d 6 p a c k a g e s i n \d + (?: \. \d + ) ? s $ / ,
159
164
'no warnings on stderr, and final output has right number of packages'
160
165
)
161
166
} )
@@ -194,6 +199,7 @@ test('removes existing node_modules/ before installing', (t) => {
194
199
. then ( ( ) => fixture . create ( testDir ) )
195
200
. then ( ( ) => common . npm ( [
196
201
'ci' ,
202
+ '--foo=asdf' ,
197
203
'--registry' , common . registry ,
198
204
'--loglevel' , 'warn'
199
205
] , EXEC_OPTS ) )
@@ -232,6 +238,7 @@ test('errors if package-lock.json missing', (t) => {
232
238
. then ( ( ) => fixture . create ( testDir ) )
233
239
. then ( ( ) => common . npm ( [
234
240
'ci' ,
241
+ '--foo=asdf' ,
235
242
'--registry' , common . registry ,
236
243
'--loglevel' , 'warn'
237
244
] , EXEC_OPTS ) )
@@ -268,6 +275,7 @@ test('errors if package-lock.json invalid', (t) => {
268
275
. then ( ( ) => fixture . create ( testDir ) )
269
276
. then ( ( ) => common . npm ( [
270
277
'ci' ,
278
+ '--foo=asdf' ,
271
279
'--registry' , common . registry ,
272
280
'--loglevel' , 'warn'
273
281
] , EXEC_OPTS ) )
0 commit comments