@@ -134,36 +134,35 @@ describe('watch mode - watch flags', { concurrency: !process.env.TEST_PARALLEL,
134134 } ) ;
135135
136136 it ( 'should not recursively re-enter watch mode for shebang scripts when NODE_OPTIONS=--watch' ,
137- { skip : common . isWindows || process . config . variables . node_without_node_options } ,
138- async ( ) => {
139- const projectDir = tmpdir . resolve ( 'project-watch-node-options-shebang' ) ;
140- mkdirSync ( projectDir ) ;
141-
142- const file = createTmpFile (
143- '#!/usr/bin/env node\nconsole.log("shebang run");\n' ,
144- '.js' ,
145- projectDir ,
146- ) ;
147- chmodSync ( file , 0o755 ) ;
148-
149- const { stdout, stderr, timedOut } = await runExecutable ( {
150- file,
151- options : {
152- cwd : projectDir ,
153- env : {
154- ...process . env ,
155- NODE_OPTIONS : '--watch' ,
156- // Ensure shebang resolves this test binary, not system node.
157- PATH : `${ path . dirname ( execPath ) } ${ path . delimiter } ${ process . env . PATH ?? '' } ` ,
158- } ,
159- } ,
160- } ) ;
161-
162- assert . strictEqual ( timedOut , false ) ;
163- assert . strictEqual ( stderr , '' ) ;
164- assert . deepStrictEqual ( stdout , [
165- 'shebang run' ,
166- `Completed running ${ inspect ( file ) } . Waiting for file changes before restarting...` ,
167- ] ) ;
168- } ) ;
137+ { skip : common . isWindows || process . config . variables . node_without_node_options } ,
138+ async ( ) => {
139+ const projectDir = tmpdir . resolve ( 'project-watch-node-options-shebang' ) ;
140+ mkdirSync ( projectDir ) ;
141+
142+ const file = createTmpFile (
143+ '#!/usr/bin/env node\nconsole.log("shebang run");\n' ,
144+ '.js' ,
145+ projectDir ,
146+ ) ;
147+ chmodSync ( file , 0o755 ) ;
148+
149+ const { stdout, stderr, timedOut } = await runExecutable ( {
150+ file,
151+ options : {
152+ cwd : projectDir ,
153+ env : {
154+ ...process . env ,
155+ NODE_OPTIONS : '--watch' ,
156+ PATH : `${ path . dirname ( execPath ) } ${ path . delimiter } ${ process . env . PATH ?? '' } ` ,
157+ } ,
158+ } ,
159+ } ) ;
160+
161+ assert . strictEqual ( timedOut , false ) ;
162+ assert . strictEqual ( stderr , '' ) ;
163+ assert . deepStrictEqual ( stdout , [
164+ 'shebang run' ,
165+ `Completed running ${ inspect ( file ) } . Waiting for file changes before restarting...` ,
166+ ] ) ;
167+ } ) ;
169168} ) ;
0 commit comments