Skip to content

Commit b06a5db

Browse files
committed
Update vitest, configure tests to run in chromium
Removes system-level dependency on chrome browser
1 parent af1d4dc commit b06a5db

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
- run: npm install --no-package-lock
1818
- name: Install Playwright for testing
19-
run: npx playwright install --with-deps
19+
run: npx playwright install
2020

2121
- run: npm test
2222

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
"@types/react": "^18.3.1",
4949
"@types/react-dom": "^18.3.1",
5050
"@vitejs/plugin-react": "^5.0.4",
51-
"@vitest/browser": "^3.2.4",
51+
"@vitest/browser": "^4.1.1",
52+
"@vitest/browser-playwright": "^4.1.1",
5253
"playwright": "^1.55.1",
5354
"react": "^18.3.1",
5455
"react-dom": "^18.3.1",
@@ -57,7 +58,7 @@
5758
"typescript": "^5.9.3",
5859
"vite": "^7.1.8",
5960
"vite-plugin-checker": "^0.11.0",
60-
"vitest": "^3.2.4"
61+
"vitest": "^4.1.1"
6162
},
6263
"peerDependencies": {
6364
"react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",

vite.config.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { defineConfig } from 'vite';
33
import react from '@vitejs/plugin-react';
44
import checker from 'vite-plugin-checker';
5+
import { playwright } from '@vitest/browser-playwright'
56

67
export default defineConfig({
78
plugins: [
@@ -13,18 +14,18 @@ export default defineConfig({
1314
browser: {
1415
enabled: true,
1516
headless: true,
16-
provider: 'playwright',
17-
screenshotFailures: false,
18-
instances: [{
19-
browser: 'chromium',
20-
launch: {
21-
channel: 'chrome',
17+
provider: playwright({
18+
launchOptions: {
2219
args: [
2320
'--autoplay-policy=no-user-gesture-required',
2421
'--disable-web-security',
2522
'--disable-features=IsolateOrigins,site-per-process'
2623
]
2724
}
25+
}),
26+
screenshotFailures: false,
27+
instances: [{
28+
browser: 'chromium',
2829
}]
2930
},
3031
setupFiles: ['.storybook/vitest.setup.ts'],

0 commit comments

Comments
 (0)