@@ -13,7 +13,7 @@ import {
1313 waitForDead ,
1414 waitForPidFile ,
1515} from "../helpers/process-wait.js" ;
16- import { runE2eGlobalSetup } from "./vitest.e2e.global-setup.js" ;
16+ import { runE2eGlobalSetup } from "../vitest /vitest.e2e.global-setup.js" ;
1717
1818type SetupCommandRunner = NonNullable < Parameters < typeof runE2eGlobalSetup > [ 0 ] > ;
1919
@@ -22,15 +22,18 @@ const PROCESS_TIMEOUT_MS = process.env.CI ? 15_000 : 5_000;
2222
2323describe ( "vitest E2E global setup" , ( ) => {
2424 it ( "runs both build commands sequentially with their exact environments" , async ( ) => {
25- const firstCommand = Promise . withResolvers < number > ( ) ;
25+ let resolveFirstCommand ! : ( status : number ) => void ;
26+ const firstCommand = new Promise < number > ( ( resolve ) => {
27+ resolveFirstCommand = resolve ;
28+ } ) ;
2629 const runCommand = vi
2730 . fn < SetupCommandRunner > ( )
28- . mockImplementationOnce ( ( ) => firstCommand . promise )
31+ . mockImplementationOnce ( ( ) => firstCommand )
2932 . mockResolvedValueOnce ( 0 ) ;
3033
3134 const setupPromise = runE2eGlobalSetup ( runCommand ) ;
3235 await vi . waitFor ( ( ) => expect ( runCommand ) . toHaveBeenCalledTimes ( 1 ) ) ;
33- firstCommand . resolve ( 0 ) ;
36+ resolveFirstCommand ( 0 ) ;
3437 await setupPromise ;
3538 expect ( runCommand . mock . calls ) . toEqual ( [
3639 [
@@ -74,7 +77,7 @@ process.stdin.once("data", () => {
7477process.stdin.resume();
7578` ,
7679 ) ;
77- const setupUrl = new URL ( "./vitest.e2e.global-setup.ts" , import . meta. url ) . href ;
80+ const setupUrl = new URL ( "../vitest /vitest.e2e.global-setup.ts" , import . meta. url ) . href ;
7881 const runnerScript = `import { runE2eSetupCommand } from ${ JSON . stringify ( setupUrl ) } ;
7982await runE2eSetupCommand([${ JSON . stringify ( fixturePath ) } ], process.env);` ;
8083 const runner = spawn (
0 commit comments