diff --git a/src/main/processHelpers.test.ts b/src/main/processHelpers.test.ts index 4f59c6bf..e3238f9b 100644 --- a/src/main/processHelpers.test.ts +++ b/src/main/processHelpers.test.ts @@ -41,13 +41,17 @@ it( 'send skips a destroyed window instead of throwing', () => { } ); // A stand-in binary: node prints the fatal line, then exits with RAxML's failure code. -const failWith = ( line: string ) => runProcess( - 'test', - eventWith( false ).event, - path.dirname( process.execPath ), - path.basename( process.execPath ), - ['-e', `process.stdout.write(${JSON.stringify( line )}); process.exit(255)`], -); +// The line goes through the env and the script has no quotes or spaces: on Windows the args pass through cmd.exe. +const failWith = ( line: string ) => { + vi.stubEnv( 'RAXMLGUI_TEST_STDOUT', line ); + return runProcess( + 'test', + eventWith( false ).event, + path.dirname( process.execPath ), + path.basename( process.execPath ), + ['-e', 'process.exitCode=255,process.stdout.write(process.env.RAXMLGUI_TEST_STDOUT)'], + ); +}; it( 'runProcess rejects with a UserFixError when the binary prints a known cause', async () => { await expect( failWith( 'ERROR: Bad base (_) at site 99 of sequence 1\n' ) ).rejects.toMatchObject( { diff --git a/src/test/setup.ts b/src/test/setup.ts index 6f9afe95..3c630b3e 100644 --- a/src/test/setup.ts +++ b/src/test/setup.ts @@ -13,8 +13,9 @@ type RunEventName = keyof typeof runEvents; const runEventNames = Object.values( runEvents ) as RunEventName[]; const runEventStub = () => (): void => {}; +// Pinned off Windows: the store tests expect the macOS/Linux binary list (raxml-ng); host.test.ts covers Windows. const host: HostInfo = { - windows: process.platform === 'win32', + windows: false, release: os.release(), arch: os.arch(), cpuModel: os.cpus()[0].model,