@@ -29,11 +29,14 @@ t.test('respects publishConfig.registry, runs appropriate scripts', async t => {
29
29
publish : 'touch scripts-publish' ,
30
30
postpublish : 'touch scripts-postpublish' ,
31
31
} ,
32
- publishConfig : { registry : alternateRegistry } ,
32
+ publishConfig : {
33
+ other : 'not defined' ,
34
+ registry : alternateRegistry ,
35
+ } ,
33
36
}
34
- const { npm, joinedOutput, prefix, registry } = await loadNpmWithRegistry ( t , {
37
+ const { npm, joinedOutput, logs , prefix, registry } = await loadNpmWithRegistry ( t , {
35
38
config : {
36
- loglevel : 'silent ' ,
39
+ loglevel : 'warn ' ,
37
40
[ `${ alternateRegistry . slice ( 6 ) } /:_authToken` ] : 'test-other-token' ,
38
41
} ,
39
42
prefixDir : {
@@ -49,6 +52,7 @@ t.test('respects publishConfig.registry, runs appropriate scripts', async t => {
49
52
t . equal ( fs . existsSync ( path . join ( prefix , 'scripts-prepublish' ) ) , false , 'did not run prepublish' )
50
53
t . equal ( fs . existsSync ( path . join ( prefix , 'scripts-publish' ) ) , true , 'ran publish' )
51
54
t . equal ( fs . existsSync ( path . join ( prefix , 'scripts-postpublish' ) ) , true , 'ran postpublish' )
55
+ t . same ( logs . warn , [ 'Unknown publishConfig config "other". This will stop working in the next major version of npm.' ] )
52
56
} )
53
57
54
58
t . test ( 're-loads publishConfig.registry if added during script process' , async t => {
0 commit comments