@@ -47,8 +47,8 @@ const defaults = {
47
47
const cliConfig = {
48
48
editor : 'vi' ,
49
49
json : false ,
50
+ location : 'user' ,
50
51
long : false ,
51
- global : false ,
52
52
cat : true ,
53
53
chai : true ,
54
54
dog : true ,
@@ -198,8 +198,8 @@ t.test('config list --json', t => {
198
198
{
199
199
editor : 'vi' ,
200
200
json : true ,
201
+ location : 'user' ,
201
202
long : false ,
202
- global : false ,
203
203
cat : true ,
204
204
chai : true ,
205
205
dog : true ,
@@ -265,7 +265,7 @@ t.test('config delete multiple key', t => {
265
265
} )
266
266
} )
267
267
268
- t . test ( 'config delete key --global' , t => {
268
+ t . test ( 'config delete key --location= global' , t => {
269
269
t . plan ( 4 )
270
270
271
271
npm . config . delete = ( key , where ) => {
@@ -277,13 +277,13 @@ t.test('config delete key --global', t => {
277
277
t . equal ( where , 'global' , 'should save global config post-delete' )
278
278
}
279
279
280
- cliConfig . global = true
280
+ cliConfig . location = 'global'
281
281
config . exec ( [ 'delete' , 'foo' ] , ( err ) => {
282
- t . error ( err , 'npm config delete key --global' )
282
+ t . error ( err , 'npm config delete key --location= global' )
283
283
} )
284
284
285
285
t . teardown ( ( ) => {
286
- cliConfig . global = false
286
+ cliConfig . location = 'user'
287
287
delete npm . config . delete
288
288
delete npm . config . save
289
289
} )
@@ -419,7 +419,7 @@ t.test('config set invalid key', t => {
419
419
} )
420
420
} )
421
421
422
- t . test ( 'config set key --global' , t => {
422
+ t . test ( 'config set key --location= global' , t => {
423
423
t . plan ( 5 )
424
424
425
425
npm . config . set = ( key , val , where ) => {
@@ -432,13 +432,13 @@ t.test('config set key --global', t => {
432
432
t . equal ( where , 'global' , 'should save global config' )
433
433
}
434
434
435
- cliConfig . global = true
435
+ cliConfig . location = 'global'
436
436
config . exec ( [ 'set' , 'foo' , 'bar' ] , ( err ) => {
437
- t . error ( err , 'npm config set key --global' )
437
+ t . error ( err , 'npm config set key --location= global' )
438
438
} )
439
439
440
440
t . teardown ( ( ) => {
441
- cliConfig . global = false
441
+ cliConfig . location = 'user'
442
442
delete npm . config . set
443
443
delete npm . config . save
444
444
} )
@@ -583,10 +583,10 @@ sign-git-commit=true`
583
583
} )
584
584
} )
585
585
586
- t . test ( 'config edit --global' , t => {
586
+ t . test ( 'config edit --location= global' , t => {
587
587
t . plan ( 6 )
588
588
589
- cliConfig . global = true
589
+ cliConfig . location = 'global'
590
590
const npmrc = 'init.author.name=Foo'
591
591
npm . config . data . set ( 'global' , {
592
592
source : '/etc/npmrc' ,
@@ -626,7 +626,7 @@ t.test('config edit --global', t => {
626
626
} )
627
627
628
628
t . teardown ( ( ) => {
629
- cliConfig . global = false
629
+ cliConfig . location = 'user'
630
630
npm . config . data . delete ( 'user' )
631
631
delete npm . config . save
632
632
} )
0 commit comments