11const t = require ( 'tap' )
22const mockNpm = require ( '../../fixtures/mock-npm' )
3+ const { stripVTControlCharacters } = require ( 'node:util' )
34
45const mockOrg = async ( t , { orgSize = 1 , orgList = { } , ...npmOpts } = { } ) => {
56 let setArgs = null
@@ -426,8 +427,7 @@ t.test('npm org ls', async t => {
426427 } ,
427428 'receieved the correct args'
428429 )
429- const { default : stripAnsi } = await import ( 'strip-ansi' )
430- const out = stripAnsi ( outputs [ 0 ] [ 0 ] )
430+ const out = stripVTControlCharacters ( outputs [ 0 ] [ 0 ] )
431431 t . match ( out , / o n e .* d e v e l o p e r / , 'contains the developer member' )
432432 t . match ( out , / t w o .* a d m i n / , 'contains the admin member' )
433433 t . match ( out , / t h r e e .* o w n e r / , 'contains the owner member' )
@@ -452,8 +452,7 @@ t.test('npm org ls - user filter', async t => {
452452 } ,
453453 'receieved the correct args'
454454 )
455- const { default : stripAnsi } = await import ( 'strip-ansi' )
456- const out = stripAnsi ( outputs [ 0 ] [ 0 ] )
455+ const out = stripVTControlCharacters ( outputs [ 0 ] [ 0 ] )
457456 t . match ( out , / u s e r n a m e .* a d m i n / , 'contains the filtered member' )
458457 t . notMatch ( out , / m i s s i n g .* a d m i n / , 'does not contain other members' )
459458} )
@@ -476,8 +475,7 @@ t.test('npm org ls - user filter, missing user', async t => {
476475 } ,
477476 'receieved the correct args'
478477 )
479- const { default : stripAnsi } = await import ( 'strip-ansi' )
480- const out = stripAnsi ( outputs [ 0 ] [ 0 ] )
478+ const out = stripVTControlCharacters ( outputs [ 0 ] [ 0 ] )
481479 t . notMatch ( out , / u s e r n a m e / , 'does not contain the requested member' )
482480 t . notMatch ( out , / m i s s i n g .* a d m i n / , 'does not contain other members' )
483481} )
0 commit comments