Skip to content

Commit 0322fe2

Browse files
authored
Merge pull request #55 from rsilivestr/run-tests-in-chromium
Update vitest, configure tests to run in chromium
2 parents af1d4dc + 4a6271f commit 0322fe2

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ jobs:
1515
node-version: 24.x
1616

1717
- run: npm install --no-package-lock
18-
- name: Install Playwright for testing
19-
run: npx playwright install --with-deps
2018

2119
- run: npm test
2220

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
],
1414
"scripts": {
1515
"build": "rimraf dist/ && tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json && tsc -p tsconfig.web.json",
16-
"pretest": "npm run build",
16+
"pretest": "npx playwright install chromium && npm run build",
1717
"test": "vitest --run",
1818
"prepare": "npm run build",
1919
"storybook": "storybook dev -p 6006",
@@ -48,16 +48,17 @@
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",
52-
"playwright": "^1.55.1",
51+
"@vitest/browser": "^4.1.1",
52+
"@vitest/browser-playwright": "^4.1.1",
53+
"playwright": "~1.58",
5354
"react": "^18.3.1",
5455
"react-dom": "^18.3.1",
5556
"rimraf": "^3.0.0",
5657
"storybook": "^9.1.10",
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)