@@ -36,11 +36,8 @@ t.test('npm.load', async t => {
36
36
} )
37
37
38
38
await t . test ( 'basic loading' , async t => {
39
- const { npm, logs, prefix : dir , cache, other } = await loadMockNpm ( t , {
39
+ const { npm, logs, cache } = await loadMockNpm ( t , {
40
40
prefixDir : { node_modules : { } } ,
41
- otherDirs : {
42
- newCache : { } ,
43
- } ,
44
41
config : {
45
42
timing : true ,
46
43
} ,
@@ -61,25 +58,11 @@ t.test('npm.load', async t => {
61
58
62
59
mockGlobals ( t , { process : { platform : 'posix' } } )
63
60
t . equal ( resolve ( npm . cache ) , resolve ( cache ) , 'cache is cache' )
64
- npm . cache = other . newCache
65
- t . equal ( npm . config . get ( 'cache' ) , other . newCache , 'cache setter sets config' )
66
- t . equal ( npm . cache , other . newCache , 'cache getter gets new config' )
67
61
t . equal ( npm . lockfileVersion , 2 , 'lockfileVersion getter' )
68
62
t . equal ( npm . prefix , npm . localPrefix , 'prefix is local prefix' )
69
63
t . not ( npm . prefix , npm . globalPrefix , 'prefix is not global prefix' )
70
- npm . globalPrefix = npm . prefix
71
- t . equal ( npm . prefix , npm . globalPrefix , 'globalPrefix setter' )
72
- npm . localPrefix = dir + '/extra/prefix'
73
- t . equal ( npm . prefix , npm . localPrefix , 'prefix is local prefix after localPrefix setter' )
74
- t . not ( npm . prefix , npm . globalPrefix , 'prefix is not global prefix after localPrefix setter' )
75
-
76
- npm . prefix = dir + '/some/prefix'
77
- t . equal ( npm . prefix , npm . localPrefix , 'prefix is local prefix after prefix setter' )
78
- t . not ( npm . prefix , npm . globalPrefix , 'prefix is not global prefix after prefix setter' )
79
- t . equal ( npm . bin , npm . localBin , 'bin is local bin after prefix setter' )
80
- t . not ( npm . bin , npm . globalBin , 'bin is not global bin after prefix setter' )
81
- t . equal ( npm . dir , npm . localDir , 'dir is local dir after prefix setter' )
82
- t . not ( npm . dir , npm . globalDir , 'dir is not global dir after prefix setter' )
64
+ t . equal ( npm . bin , npm . localBin , 'bin is local bin' )
65
+ t . not ( npm . bin , npm . globalBin , 'bin is not global bin' )
83
66
84
67
npm . config . set ( 'global' , true )
85
68
t . equal ( npm . prefix , npm . globalPrefix , 'prefix is global prefix after setting global' )
@@ -89,12 +72,6 @@ t.test('npm.load', async t => {
89
72
t . equal ( npm . dir , npm . globalDir , 'dir is global dir after setting global' )
90
73
t . not ( npm . dir , npm . localDir , 'dir is not local dir after setting global' )
91
74
92
- npm . prefix = dir + '/new/global/prefix'
93
- t . equal ( npm . prefix , npm . globalPrefix , 'prefix is global prefix after prefix setter' )
94
- t . not ( npm . prefix , npm . localPrefix , 'prefix is not local prefix after prefix setter' )
95
- t . equal ( npm . bin , npm . globalBin , 'bin is global bin after prefix setter' )
96
- t . not ( npm . bin , npm . localBin , 'bin is not local bin after prefix setter' )
97
-
98
75
mockGlobals ( t , { process : { platform : 'win32' } } )
99
76
t . equal ( npm . bin , npm . globalBin , 'bin is global bin in windows mode' )
100
77
t . equal ( npm . dir , npm . globalDir , 'dir is global dir in windows mode' )
0 commit comments