@@ -19,6 +19,9 @@ const EXEC_OPTS = { cwd: testDir }
1919const PKG = {
2020 name : 'top' ,
2121 version : '1.2.3' ,
22+ scripts : {
23+ install : 'node -p process.env.npm_config_foo'
24+ } ,
2225 dependencies : {
2326 optimist : '0.6.0' ,
2427 clean : '2.1.6'
@@ -77,6 +80,7 @@ test('basic installation', (t) => {
7780 . then ( ( ) => fixture . create ( testDir ) )
7881 . then ( ( ) => common . npm ( [
7982 'ci' ,
83+ '--foo=asdf' ,
8084 '--registry' , common . registry ,
8185 '--loglevel' , 'warn'
8286 ] , EXEC_OPTS ) )
@@ -88,7 +92,7 @@ test('basic installation', (t) => {
8892 t . equal ( stderr . trim ( ) , '' , 'no output on stderr' )
8993 t . match (
9094 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 $ / ,
9296 'no warnings on stderr, and final output has right number of packages'
9397 )
9498 return fs . readdirAsync ( path . join ( testDir , 'node_modules' ) )
@@ -144,6 +148,7 @@ test('supports npm-shrinkwrap.json as well', (t) => {
144148 . then ( ( ) => fixture . create ( testDir ) )
145149 . then ( ( ) => common . npm ( [
146150 'ci' ,
151+ '--foo=asdf' ,
147152 '--registry' , common . registry ,
148153 '--loglevel' , 'warn'
149154 ] , EXEC_OPTS ) )
@@ -155,7 +160,7 @@ test('supports npm-shrinkwrap.json as well', (t) => {
155160 t . equal ( stderr . trim ( ) , '' , 'no output on stderr' )
156161 t . match (
157162 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 $ / ,
159164 'no warnings on stderr, and final output has right number of packages'
160165 )
161166 } )
@@ -194,6 +199,7 @@ test('removes existing node_modules/ before installing', (t) => {
194199 . then ( ( ) => fixture . create ( testDir ) )
195200 . then ( ( ) => common . npm ( [
196201 'ci' ,
202+ '--foo=asdf' ,
197203 '--registry' , common . registry ,
198204 '--loglevel' , 'warn'
199205 ] , EXEC_OPTS ) )
@@ -232,6 +238,7 @@ test('errors if package-lock.json missing', (t) => {
232238 . then ( ( ) => fixture . create ( testDir ) )
233239 . then ( ( ) => common . npm ( [
234240 'ci' ,
241+ '--foo=asdf' ,
235242 '--registry' , common . registry ,
236243 '--loglevel' , 'warn'
237244 ] , EXEC_OPTS ) )
@@ -268,6 +275,7 @@ test('errors if package-lock.json invalid', (t) => {
268275 . then ( ( ) => fixture . create ( testDir ) )
269276 . then ( ( ) => common . npm ( [
270277 'ci' ,
278+ '--foo=asdf' ,
271279 '--registry' , common . registry ,
272280 '--loglevel' , 'warn'
273281 ] , EXEC_OPTS ) )
0 commit comments