@@ -60,7 +60,11 @@ test.serial('Preserve home ".npmrc"', async t => {
60
60
await require ( '../lib/set-npmrc-auth' ) ( npmrc , 'http://custom.registry.com' , { cwd, env, logger : t . context . logger } ) ;
61
61
62
62
t . is ( ( await readFile ( npmrc ) ) . toString ( ) , `home_config = test\n//custom.registry.com/:_authToken = \${NPM_TOKEN}` ) ;
63
- t . deepEqual ( t . context . log . args [ 1 ] , [ `Wrote NPM_TOKEN to ${ npmrc } ` ] ) ;
63
+ t . deepEqual ( t . context . log . args [ 1 ] , [
64
+ 'Reading npm config from %s' ,
65
+ [ path . resolve ( process . env . HOME , '.npmrc' ) ] . join ( ', ' ) ,
66
+ ] ) ;
67
+ t . deepEqual ( t . context . log . args [ 2 ] , [ `Wrote NPM_TOKEN to ${ npmrc } ` ] ) ;
64
68
} ) ;
65
69
66
70
test . serial ( 'Preserve home and local ".npmrc"' , async t => {
@@ -79,7 +83,11 @@ test.serial('Preserve home and local ".npmrc"', async t => {
79
83
( await readFile ( npmrc ) ) . toString ( ) ,
80
84
`home_config = test\ncwd_config = test\n//custom.registry.com/:_authToken = \${NPM_TOKEN}`
81
85
) ;
82
- t . deepEqual ( t . context . log . args [ 1 ] , [ `Wrote NPM_TOKEN to ${ npmrc } ` ] ) ;
86
+ t . deepEqual ( t . context . log . args [ 1 ] , [
87
+ 'Reading npm config from %s' ,
88
+ [ path . resolve ( process . env . HOME , '.npmrc' ) , path . resolve ( cwd , '.npmrc' ) ] . join ( ', ' ) ,
89
+ ] ) ;
90
+ t . deepEqual ( t . context . log . args [ 2 ] , [ `Wrote NPM_TOKEN to ${ npmrc } ` ] ) ;
83
91
} ) ;
84
92
85
93
test . serial ( 'Preserve all ".npmrc" if auth is already configured' , async t => {
@@ -94,7 +102,10 @@ test.serial('Preserve all ".npmrc" if auth is already configured', async t => {
94
102
await require ( '../lib/set-npmrc-auth' ) ( npmrc , 'http://custom.registry.com' , { cwd, env : { } , logger : t . context . logger } ) ;
95
103
96
104
t . is ( ( await readFile ( npmrc ) ) . toString ( ) , `home_config = test\n//custom.registry.com/:_authToken = \${NPM_TOKEN}` ) ;
97
- t . is ( t . context . log . callCount , 1 ) ;
105
+ t . deepEqual ( t . context . log . args [ 1 ] , [
106
+ 'Reading npm config from %s' ,
107
+ [ path . resolve ( process . env . HOME , '.npmrc' ) , path . resolve ( cwd , '.npmrc' ) ] . join ( ', ' ) ,
108
+ ] ) ;
98
109
} ) ;
99
110
100
111
test . serial ( 'Preserve ".npmrc" if auth is already configured for a scoped package' , async t => {
@@ -115,7 +126,10 @@ test.serial('Preserve ".npmrc" if auth is already configured for a scoped packag
115
126
( await readFile ( npmrc ) ) . toString ( ) ,
116
127
`home_config = test\n@scope:registry=http://custom.registry.com\n//custom.registry.com/:_authToken = \${NPM_TOKEN}`
117
128
) ;
118
- t . is ( t . context . log . callCount , 1 ) ;
129
+ t . deepEqual ( t . context . log . args [ 1 ] , [
130
+ 'Reading npm config from %s' ,
131
+ [ path . resolve ( process . env . HOME , '.npmrc' ) , path . resolve ( cwd , '.npmrc' ) ] . join ( ', ' ) ,
132
+ ] ) ;
119
133
} ) ;
120
134
121
135
test . serial ( 'Throw error if "NPM_TOKEN" is missing' , async t => {
@@ -148,7 +162,7 @@ test.serial('Emulate npm config resolution if "NPM_CONFIG_USERCONFIG" is set', a
148
162
} ) ;
149
163
150
164
t . is ( ( await readFile ( npmrc ) ) . toString ( ) , `//custom.registry.com/:_authToken = \${NPM_TOKEN}` ) ;
151
- t . is ( t . context . log . callCount , 1 ) ;
165
+ t . deepEqual ( t . context . log . args [ 1 ] , [ 'Reading npm config from %s' , [ path . resolve ( cwd , '.custom-npmrc' ) ] . join ( ', ' ) ] ) ;
152
166
} ) ;
153
167
154
168
test . serial ( 'Throw error if "NPM_USERNAME" is missing' , async t => {
0 commit comments