Skip to content

Commit

Permalink
fix: don't use bun --bun for playwright (take 2)
Browse files Browse the repository at this point in the history
  • Loading branch information
exKAZUu committed Oct 22, 2024
1 parent eeeb66f commit 47f1de1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/wb/src/commands/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export async function test(
continue;
}
case 'trace': {
await runWithSpawn(`YARN playwright show-trace`, project, argv);
await runWithSpawn(`BUN playwright show-trace`, project, argv);
continue;
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/wb/src/scripts/execution/baseScripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export abstract class BaseScripts {
return `WB_ENV=${env} NEXT_PUBLIC_WB_ENV=${env} APP_ENV=${env} PORT=8080 YARN concurrently --kill-others --raw --success first
"rm -Rf ${prismaDirectory}/mount && ${startCommand} && exit 1"
"wait-on -t 600000 -i 2000 http-get://127.0.0.1:8080
&& YARN playwright ${playwrightArgs === 'test tests/e2e' && argv.target ? playwrightArgs.replace('tests/e2e', argv.target) : playwrightArgs}${suffix}"`;
&& BUN playwright ${playwrightArgs === 'test tests/e2e' && argv.target ? playwrightArgs.replace('tests/e2e', argv.target) : playwrightArgs}${suffix}"`;
}

testE2EDev(
Expand All @@ -63,7 +63,7 @@ export abstract class BaseScripts {
return `WB_ENV=${env} NEXT_PUBLIC_WB_ENV=${env} APP_ENV=${env} PORT=8080 YARN concurrently --kill-others --raw --success first
"${startCommand} && exit 1"
"wait-on -t 600000 -i 2000 http-get://127.0.0.1:8080
&& YARN playwright ${playwrightArgs === 'test tests/e2e' && argv.target ? playwrightArgs.replace('tests/e2e', argv.target) : playwrightArgs}${suffix}"`;
&& BUN playwright ${playwrightArgs === 'test tests/e2e' && argv.target ? playwrightArgs.replace('tests/e2e', argv.target) : playwrightArgs}${suffix}"`;
}

abstract testStart(project: Project, argv: ScriptArgv): string;
Expand Down
5 changes: 4 additions & 1 deletion packages/wb/src/scripts/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ function configureEnv(env: Record<string, string | undefined>, opts: Options): R
}

function fixBunCommand(command: string): string {
return command.includes('next dev') || command.includes('pm2-runtime') || command.includes('test/e2e-additional')
return command.includes('next dev') ||
command.includes('playwright') ||
command.includes('pm2-runtime') ||
command.includes('test/e2e-additional')
? command.replaceAll('bun --bun', 'bun')
: command;
}

0 comments on commit 47f1de1

Please sign in to comment.