File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change
1
+ import { rimraf } from "rimraf" ;
2
+
3
+ async function globalTeardown ( ) {
4
+ if ( ! process . env . CI ) {
5
+ console . log ( "Cleaning up test-results directory..." ) ;
6
+ // Add a small delay to ensure all Playwright files are written
7
+ await new Promise ( ( resolve ) => setTimeout ( resolve , 100 ) ) ;
8
+ await rimraf ( "./e2e/test-results" ) ;
9
+ console . log ( "Test-results directory cleaned up." ) ;
10
+ }
11
+ }
12
+
13
+ export default globalTeardown ;
14
+
15
+ // Call the function when this script is run directly
16
+ if ( import . meta. url === `file://${ process . argv [ 1 ] } ` ) {
17
+ globalTeardown ( ) . catch ( console . error ) ;
18
+ }
Original file line number Diff line number Diff line change 21
21
"preview" : " vite preview --port 6274" ,
22
22
"test" : " jest --config jest.config.cjs" ,
23
23
"test:watch" : " jest --config jest.config.cjs --watch" ,
24
- "test:e2e" : " playwright test e2e"
24
+ "test:e2e" : " playwright test e2e && npm run cleanup:e2e" ,
25
+ "cleanup:e2e" : " node e2e/global-teardown.js"
25
26
},
26
27
"dependencies" : {
27
28
"@modelcontextprotocol/sdk" : " ^1.12.1" ,
You can’t perform that action at this time.
0 commit comments