Skip to content

Commit f24c1cc

Browse files
committed
chore: set up vitest browser mode with playwright
1 parent 5701cf2 commit f24c1cc

File tree

3 files changed

+172
-5
lines changed

3 files changed

+172
-5
lines changed

package-lock.json

Lines changed: 162 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@
2222
"@biomejs/biome": "2.3.2",
2323
"@commitlint/cli": "20.1.0",
2424
"@commitlint/config-conventional": "20.0.0",
25-
"lefthook": "2.0.2",
2625
"@types/jsdom": "^27.0.0",
26+
"@vitest/browser-playwright": "^4.0.1",
2727
"jsdom": "^27.0.1",
28-
"vitest": "4.0.1"
28+
"lefthook": "2.0.2",
29+
"vitest": "^4.0.1"
2930
},
3031
"peerDependencies": {
3132
"typescript": "5.9.3"

vitest.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717
import path from 'node:path';
18+
import { playwright } from '@vitest/browser-playwright';
1819
import { defineConfig } from 'vitest/config';
1920

2021
export default defineConfig({
@@ -29,6 +30,12 @@ export default defineConfig({
2930
test: {
3031
environment: 'jsdom',
3132
globals: true,
33+
browser: {
34+
provider: playwright(),
35+
enabled: true,
36+
headless: true,
37+
instances: [{ browser: 'chromium' }],
38+
},
3239
coverage: {
3340
provider: 'v8',
3441
reporter: ['text', 'json', 'html'],

0 commit comments

Comments
 (0)