@@ -5,7 +5,6 @@ common.requireNoPackageJSONAbove();
55
66const { it, describe } = require ( 'node:test' ) ;
77const assert = require ( 'node:assert' ) ;
8- const path = require ( 'node:path' ) ;
98
109const fixtures = require ( '../common/fixtures' ) ;
1110const envSuffix = common . isWindows ? '-windows' : '' ;
@@ -144,36 +143,19 @@ describe('node --run [command]', () => {
144143 it ( 'appends positional arguments' , async ( ) => {
145144 const child = await common . spawnPromisified (
146145 process . execPath ,
147- [ '--run' , `positional-args${ envSuffix } ` , '--' , '--help "hello world test"' , 'A' , 'B' , 'C' ] ,
146+ [ '--run' , `positional-args${ envSuffix } ` , '--' , '--help "hello world test"' , 'A' , 'B' , 'C' , 'I think therefore I\'m' ] ,
148147 { cwd : fixtures . path ( 'run-script' ) } ,
149148 ) ;
150149 if ( common . isWindows ) {
151- assert . match ( child . stdout , / A r g u m e n t s : ' - - h e l p " " h e l l o w o r l d t e s t " " A B C ' / ) ;
150+ assert . match ( child . stdout , / A r g u m e n t s : ' - - h e l p " " h e l l o w o r l d t e s t " " A B C " I t h i n k t h e r e f o r e I ' m " ' / ) ;
152151 } else {
153- assert . match ( child . stdout , / A r g u m e n t s : ' - - h e l p " h e l l o w o r l d t e s t " A B C ' / ) ;
152+ assert . match ( child . stdout , / A r g u m e n t s : ' - - h e l p " h e l l o w o r l d t e s t " A B C I t h i n k t h e r e f o r e I ' m ' / ) ;
154153 }
155- assert . match ( child . stdout , / T h e t o t a l n u m b e r o f a r g u m e n t s a r e : 4 / ) ;
154+ assert . match ( child . stdout , / T h e t o t a l n u m b e r o f a r g u m e n t s i s : 5 / ) ;
156155 assert . strictEqual ( child . stderr , '' ) ;
157156 assert . strictEqual ( child . code , 0 ) ;
158157 } ) ;
159158
160- it ( 'handles positional arguments with quotes' , async ( ) => {
161- const child = await common . spawnPromisified (
162- process . execPath ,
163- [ '--run' , 'repeat-args' , '--' , 'I think therefore I\'m' ] ,
164- {
165- cwd : fixtures . path ( 'run-script' ) ,
166- env : { ...process . env , PATH : `${ path . dirname ( process . execPath ) } :${ process . env . PATH } ` } ,
167- } ,
168- ) ;
169- assert . deepStrictEqual ( child , {
170- stdout : `["I think therefore I'm"]\n` ,
171- stderr : '' ,
172- code : 0 ,
173- signal : null ,
174- } ) ;
175- } ) ;
176-
177159 it ( 'should set PATH environment variable with paths appended with node_modules/.bin' , async ( ) => {
178160 const child = await common . spawnPromisified (
179161 process . execPath ,
0 commit comments