@@ -149,11 +149,7 @@ t.test('ls', (t) => {
149149 ...simpleNmFixture ,
150150 } )
151151 ls . exec ( [ ] , ( err ) => {
152- t . match ( err . code , 'ELSPROBLEMS' , 'should have ELSPROBLEMS error code' )
153- t . matchSnapshot (
154- redactCwd ( err . message ) ,
155- 'should log all extraneous deps on error msg'
156- )
152+ t . error ( err ) // should not error for extraneous
157153 t . matchSnapshot ( redactCwd ( result ) , 'should output tree missing name/version of top-level package' )
158154 t . end ( )
159155 } )
@@ -171,12 +167,7 @@ t.test('ls', (t) => {
171167 ...simpleNmFixture ,
172168 } )
173169 ls . exec ( [ ] , ( err ) => {
174- t . equal ( err . code , 'ELSPROBLEMS' , 'should have error code' )
175- t . equal (
176- redactCwd ( err . message ) ,
177- 'extraneous: lorem@1.0.0 {CWD}/tap-testdir-ls-ls-extraneous-deps/node_modules/lorem' ,
178- 'should log extraneous dep as error'
179- )
170+ t . error ( err ) // should not error for extraneous
180171 t . matchSnapshot ( redactCwd ( result ) , 'should output containing problems info' )
181172 t . end ( )
182173 } )
@@ -1410,7 +1401,7 @@ t.test('ls', (t) => {
14101401 } )
14111402
14121403 ls . exec ( [ 'c' ] , ( err ) => {
1413- t . match ( err . code , 'ELSPROBLEMS' , ' should have ELSPROBLEMS error code' )
1404+ t . error ( err ) // should not error for extraneous
14141405 t . matchSnapshot ( redactCwd ( result ) , 'should print tree and not duplicate child of missing items' )
14151406 t . end ( )
14161407 } )
@@ -1570,11 +1561,7 @@ t.test('ls --parseable', (t) => {
15701561 ...simpleNmFixture ,
15711562 } )
15721563 ls . exec ( [ ] , ( err ) => {
1573- t . match ( err . code , 'ELSPROBLEMS' , 'should have ELSPROBLEMS error code' )
1574- t . matchSnapshot (
1575- redactCwd ( err . message ) ,
1576- 'should log all extraneous deps on error msg'
1577- )
1564+ t . error ( err ) // should not error for extraneous
15781565 t . matchSnapshot ( redactCwd ( result ) , 'should output parseable missing name/version of top-level package' )
15791566 t . end ( )
15801567 } )
@@ -1592,7 +1579,7 @@ t.test('ls --parseable', (t) => {
15921579 ...simpleNmFixture ,
15931580 } )
15941581 ls . exec ( [ ] , ( err ) => {
1595- t . equal ( err . code , 'ELSPROBLEMS' , ' should have error code' )
1582+ t . error ( err ) // should not error for extraneous
15961583 t . matchSnapshot ( redactCwd ( result ) , 'should output containing problems info' )
15971584 t . end ( )
15981585 } )
@@ -1973,8 +1960,7 @@ t.test('ls --parseable', (t) => {
19731960 ...simpleNmFixture ,
19741961 } )
19751962 ls . exec ( [ ] , ( err ) => {
1976- t . equal ( err . code , 'ELSPROBLEMS' , 'should have error code' )
1977- t . match ( redactCwd ( err . message ) , 'extraneous: lorem@1.0.0 {CWD}/tap-testdir-ls-ls---parseable---long-with-extraneous-deps/node_modules/lorem' , 'should have error code' )
1963+ t . error ( err ) // should not error for extraneous
19781964 t . matchSnapshot ( redactCwd ( result ) , 'should output long parseable output with extraneous info' )
19791965 t . end ( )
19801966 } )
@@ -2414,7 +2400,7 @@ t.test('ls --json', (t) => {
24142400 ...simpleNmFixture ,
24152401 } )
24162402 ls . exec ( [ ] , ( err ) => {
2417- t . match ( err , { code : 'ELSPROBLEMS' } , ' should list dep problems' )
2403+ t . error ( err ) // should not error for extraneous
24182404 t . same (
24192405 jsonParse ( result ) ,
24202406 {
@@ -2470,16 +2456,7 @@ t.test('ls --json', (t) => {
24702456 ...simpleNmFixture ,
24712457 } )
24722458 ls . exec ( [ ] , ( err ) => {
2473- t . equal (
2474- redactCwd ( err . message ) ,
2475- 'extraneous: lorem@1.0.0 {CWD}/tap-testdir-ls-ls---json-extraneous-deps/node_modules/lorem' ,
2476- 'should log extraneous dep as error'
2477- )
2478- t . equal (
2479- err . code ,
2480- 'ELSPROBLEMS' ,
2481- 'should have ELSPROBLEMS error code'
2482- )
2459+ t . error ( err ) // should not error for extraneous
24832460 t . same (
24842461 jsonParse ( result ) ,
24852462 {
0 commit comments