@@ -44,23 +44,21 @@ t.test('shim contents', t => {
4444
4545 t . test ( 'bash' , t => {
4646 const { diff, letters } = diffFiles ( SHIMS . npm , SHIMS . npx )
47- t . match ( diff [ 0 ] . split ( '\n' ) . reverse ( ) . join ( '' ) , / ^ N P X _ C L I _ J S = / , 'has NPX_CLI' )
48- t . equal ( diff . length , 1 )
47+ t . strictSame ( diff , [ ] )
4948 t . strictSame ( [ ...letters ] , [ 'M' , 'X' ] , 'all other changes are m->x' )
5049 t . end ( )
5150 } )
5251
5352 t . test ( 'cmd' , t => {
5453 const { diff, letters } = diffFiles ( SHIMS [ 'npm.cmd' ] , SHIMS [ 'npx.cmd' ] )
55- t . match ( diff [ 0 ] , / ^ S E T " N P X _ C L I _ J S = / , 'has NPX_CLI' )
56- t . equal ( diff . length , 1 )
54+ t . strictSame ( diff , [ ] )
5755 t . strictSame ( [ ...letters ] , [ 'M' , 'X' ] , 'all other changes are m->x' )
5856 t . end ( )
5957 } )
6058
6159 t . test ( 'pwsh' , t => {
6260 const { diff, letters } = diffFiles ( SHIMS [ 'npm.ps1' ] , SHIMS [ 'npx.ps1' ] )
63- t . equal ( diff . length , 0 )
61+ t . strictSame ( diff , [ ] )
6462 t . strictSame ( [ ...letters ] , [ 'M' , 'X' ] , 'all other changes are m->x' )
6563 t . end ( )
6664 } )
@@ -96,13 +94,12 @@ t.test('run shims', t => {
9694 node_modules : {
9795 npm : {
9896 bin : {
99- 'npx-cli.js' : `throw new Error('this should not be called')` ,
100- 'npm-cli.js' : `
101- const assert = require('assert')
97+ 'npm-prefix.js' : `
10298 const { resolve } = require('path')
103- assert.equal(process.argv.slice(2).join(' '), 'prefix -g')
10499 console.log(resolve(__dirname, '../../../global-prefix'))
105100 ` ,
101+ 'npx-cli.js' : `throw new Error('local npx should not be called')` ,
102+ 'npm-cli.js' : `throw new Error('local npm should not be called')` ,
106103 } ,
107104 } ,
108105 } ,
0 commit comments