@@ -40,31 +40,19 @@ t.test('prune with lockfile', async t => {
4040} )
4141
4242t . test ( 'prune with lockfile with implicit optional peer dependencies' , async t => {
43- const opts = { }
44-
45- // todo: for some reason on Windows when doing this test NPM looks for
46- // the cache in the home directory, resulting in an unexpected real
47- // call being made to the registry
48- if ( process . platform === 'win32' ) {
49- opts . cache = 'C:\\npm\\cache\\_cacache'
50- }
51-
5243 const path = fixture ( t , 'prune-lockfile-optional-peer' )
53- const tree = await pruneTree ( path , opts )
44+ const tree = await pruneTree ( path , { audit : false } )
5445
5546 const dep = tree . children . get ( 'dedent' )
56- t . ok ( dep , 'required prod dep was pruned from tree' )
47+ t . ok ( dep , 'required prod dep was not pruned from tree' )
5748
5849 const optionalPeerDep = tree . children . get ( 'babel-plugin-macros' )
59- t . notOk ( optionalPeerDep , 'all listed optional peer deps pruned from tree' )
50+ t . notOk ( optionalPeerDep , 'optional peer dep was pruned from tree' )
6051
61- t . matchSnapshot (
62- require ( path + '/package-lock.json' ) ,
63- 'should remove optional peer dependencies in package-lock.json'
64- )
65- t . matchSnapshot (
66- printTree ( tree ) ,
67- 'should remove all deps from reified tree'
52+ t . notMatch (
53+ fs . readFileSync ( path + '/package-lock.json' ) ,
54+ 'node_modules/babel-plugin-macros' ,
55+ 'should remove optional peer dep from package-lock.json'
6856 )
6957} )
7058
0 commit comments