File tree Expand file tree Collapse file tree 7 files changed +183
-52
lines changed Expand file tree Collapse file tree 7 files changed +183
-52
lines changed Original file line number Diff line number Diff line change 52
52
53
53
- name : Install dependencies
54
54
run : yarn --immutable
55
+ env :
56
+ PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD : true
55
57
56
58
- name : Build package
57
59
run : yarn build
91
93
restore-keys : |
92
94
${{ runner.os }}-${{ env.cache-name }}
93
95
96
+ - name : Cache ~/.cache/ms-playwright
97
+ id : playwright-cache
98
+ uses : actions/cache@v4
99
+ env :
100
+ cache-name : playwright-cache
101
+ with :
102
+ path : ~/.cache/ms-playwright
103
+ key : ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
104
+
94
105
- name : Use Node.js
95
106
uses : actions/setup-node@v4
96
107
with :
@@ -102,5 +113,9 @@ jobs:
102
113
- name : Install dependencies
103
114
run : yarn --immutable
104
115
116
+ - name : Install Playwright browsers
117
+ if : steps.playwright-cache.outputs.cache-hit != 'true'
118
+ run : yarn workspace react-clock playwright install chromium-headless-shell
119
+
105
120
- name : Run tests
106
121
run : yarn unit
Original file line number Diff line number Diff line change 18
18
! ** /.yarn /versions
19
19
20
20
# Project-generated directories and files
21
+ __screenshots__
21
22
coverage
22
23
dist
23
24
node_modules
Original file line number Diff line number Diff line change
1
+ enableScripts : false
2
+
1
3
logFilters :
2
4
- code : YN0076
3
5
level : discard
Original file line number Diff line number Diff line change 57
57
"@types/node" : " *" ,
58
58
"@types/react" : " *" ,
59
59
"@types/react-dom" : " *" ,
60
+ "@vitest/browser" : " ^3.2.3" ,
60
61
"cpy-cli" : " ^5.0.0" ,
61
- "happy-dom " : " ^15.10.2 " ,
62
+ "playwright " : " ^1.51.1 " ,
62
63
"react" : " ^18.2.0" ,
63
64
"react-dom" : " ^18.2.0" ,
64
65
"typescript" : " ^5.5.2" ,
65
- "vitest" : " ^3.2.3"
66
+ "vitest" : " ^3.2.3" ,
67
+ "vitest-browser-react" : " ^1.0.1"
66
68
},
67
69
"peerDependencies" : {
68
70
"@types/react" : " ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" ,
Original file line number Diff line number Diff line change 13
13
"skipLibCheck" : true ,
14
14
"strict" : true ,
15
15
"target" : " es2018" ,
16
+ "types" : [" @vitest/browser/matchers" ],
16
17
"verbatimModuleSyntax" : true
17
18
},
18
19
"exclude" : [" dist" ]
Original file line number Diff line number Diff line change @@ -2,7 +2,12 @@ import { defineConfig } from 'vitest/config';
2
2
3
3
export default defineConfig ( {
4
4
test : {
5
- environment : 'happy-dom' ,
5
+ browser : {
6
+ enabled : true ,
7
+ headless : true ,
8
+ instances : [ { browser : 'chromium' } ] ,
9
+ provider : 'playwright' ,
10
+ } ,
6
11
setupFiles : 'vitest.setup.ts' ,
7
12
watch : false ,
8
13
} ,
You can’t perform that action at this time.
0 commit comments