@@ -3250,4 +3250,51 @@ t.test('install stategy linked', async (t) => {
32503250 t . ok ( store . isDirectory ( ) , 'abbrev got installed' )
32513251 t . ok ( abbrev . isSymbolicLink ( ) , 'abbrev got installed' )
32523252 } )
3253+
3254+ t . test ( 'should not crash with --omit=dev in workspaces' , async ( t ) => {
3255+ const testdir = t . testdir ( {
3256+ project : {
3257+ 'package.json' : JSON . stringify ( {
3258+ name : 'my-monorepo' ,
3259+ version : '1.0.0' ,
3260+ workspaces : [ 'packages/*' ] ,
3261+ dependencies : {
3262+ abbrev : '1.1.1' ,
3263+ } ,
3264+ devDependencies : {
3265+ abbrev : '1.1.1' ,
3266+ } ,
3267+ } ) ,
3268+ packages : {
3269+ 'my-lib' : {
3270+ 'package.json' : JSON . stringify ( {
3271+ name : 'my-lib' ,
3272+ version : '1.0.0' ,
3273+ dependencies : {
3274+ abbrev : '1.1.1' ,
3275+ } ,
3276+ } ) ,
3277+ } ,
3278+ } ,
3279+ } ,
3280+ } )
3281+
3282+ tnock ( t , 'https://registry.npmjs.org' )
3283+ . get ( '/abbrev' )
3284+ . reply ( 200 , abbrevPackument )
3285+
3286+ tnock ( t , 'https://registry.npmjs.org' )
3287+ . get ( '/abbrev/-/abbrev-1.1.1.tgz' )
3288+ . reply ( 200 , abbrevTGZ )
3289+
3290+ const path = resolve ( testdir , 'project' )
3291+ const arb = new Arborist ( {
3292+ path,
3293+ registry : 'https://registry.npmjs.org' ,
3294+ cache : resolve ( testdir , 'cache' ) ,
3295+ installStrategy : 'linked' ,
3296+ } )
3297+ await arb . reify ( { installStrategy : 'linked' , omit : [ 'dev' ] } )
3298+ t . pass ( 'reify with --omit=dev did not crash' )
3299+ } )
32533300} )
0 commit comments