diff --git a/packages/exec/__tests__/scripts/spawn-wait-for-file.js b/packages/exec/__tests__/scripts/spawn-wait-for-file.js index 6c777491..720b7849 100644 --- a/packages/exec/__tests__/scripts/spawn-wait-for-file.js +++ b/packages/exec/__tests__/scripts/spawn-wait-for-file.js @@ -19,9 +19,14 @@ if (!filePath) { // This creates a grandchild process that holds the stdio handles open // after this process (the child) exits const waitScript = path.join(__dirname, 'wait-for-file.js') +const isWindows = process.platform === 'win32' + +// On Windows, use detached:true to properly keep streams open +// On Unix, detached:true also works and creates a new process group const child = childProcess.spawn(process.execPath, [waitScript, `file=${filePath}`], { stdio: ['ignore', 'inherit', 'inherit'], - detached: process.platform !== 'win32' + detached: true, + windowsHide: true }) // Don't wait for child to exit