diff --git a/tests/rsbuild/rstest.ts b/tests/rsbuild/rstest.ts index 4b43814..2ccd547 100644 --- a/tests/rsbuild/rstest.ts +++ b/tests/rsbuild/rstest.ts @@ -1,5 +1,5 @@ import type { RunOptions } from '../../types'; -import { runInRepo } from '../../utils'; +import { $, runInRepo } from '../../utils'; export async function test(options: RunOptions) { await runInRepo({ @@ -8,5 +8,8 @@ export async function test(options: RunOptions) { branch: process.env.RSTEST ?? 'main', // ignore snapshot changes test: ['test -u'], + beforeTest: async () => { + await $`npx playwright install chromium webkit`; + }, }); } diff --git a/tests/rslib/rstest.ts b/tests/rslib/rstest.ts index e104597..a781cf4 100644 --- a/tests/rslib/rstest.ts +++ b/tests/rslib/rstest.ts @@ -1,5 +1,5 @@ import type { RunOptions } from '../../types'; -import { runInRepo } from '../../utils'; +import { $, runInRepo } from '../../utils'; export async function test(options: RunOptions) { await runInRepo({ @@ -7,5 +7,8 @@ export async function test(options: RunOptions) { repo: 'web-infra-dev/rstest', branch: process.env.RSTEST ?? 'main', test: ['test'], + beforeTest: async () => { + await $`npx playwright install chromium webkit`; + }, }); } diff --git a/tests/rspack/rstest.ts b/tests/rspack/rstest.ts index 9e4c234..bec442e 100644 --- a/tests/rspack/rstest.ts +++ b/tests/rspack/rstest.ts @@ -1,5 +1,5 @@ import type { RunOptions } from '../../types'; -import { runInRepo } from '../../utils'; +import { $, runInRepo } from '../../utils'; export async function test(options: RunOptions) { await runInRepo({ @@ -8,5 +8,8 @@ export async function test(options: RunOptions) { branch: process.env.RSTEST ?? 'main', // ignore snapshot changes test: ['test -u', 'e2e'], + beforeTest: async () => { + await $`npx playwright install chromium webkit`; + }, }); }