Skip to content

Commit a3c2dcf

Browse files
authored
chore: rstest playwright install (#7)
1 parent bba6a5e commit a3c2dcf

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

tests/rsbuild/rstest.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { RunOptions } from '../../types';
2-
import { runInRepo } from '../../utils';
2+
import { $, runInRepo } from '../../utils';
33

44
export async function test(options: RunOptions) {
55
await runInRepo({
@@ -8,5 +8,8 @@ export async function test(options: RunOptions) {
88
branch: process.env.RSTEST ?? 'main',
99
// ignore snapshot changes
1010
test: ['test -u'],
11+
beforeTest: async () => {
12+
await $`npx playwright install chromium webkit`;
13+
},
1114
});
1215
}

tests/rslib/rstest.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import type { RunOptions } from '../../types';
2-
import { runInRepo } from '../../utils';
2+
import { $, runInRepo } from '../../utils';
33

44
export async function test(options: RunOptions) {
55
await runInRepo({
66
...options,
77
repo: 'web-infra-dev/rstest',
88
branch: process.env.RSTEST ?? 'main',
99
test: ['test'],
10+
beforeTest: async () => {
11+
await $`npx playwright install chromium webkit`;
12+
},
1013
});
1114
}

tests/rspack/rstest.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { RunOptions } from '../../types';
2-
import { runInRepo } from '../../utils';
2+
import { $, runInRepo } from '../../utils';
33

44
export async function test(options: RunOptions) {
55
await runInRepo({
@@ -8,5 +8,8 @@ export async function test(options: RunOptions) {
88
branch: process.env.RSTEST ?? 'main',
99
// ignore snapshot changes
1010
test: ['test -u', 'e2e'],
11+
beforeTest: async () => {
12+
await $`npx playwright install chromium webkit`;
13+
},
1114
});
1215
}

0 commit comments

Comments
 (0)