Skip to content

Commit 1807542

Browse files
committed
Cleanup client/e2e/test-results/ after test:e2e
1 parent 8b3613e commit 1807542

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

client/e2e/global-teardown.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
}

client/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"preview": "vite preview --port 6274",
2222
"test": "jest --config jest.config.cjs",
2323
"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"
2526
},
2627
"dependencies": {
2728
"@modelcontextprotocol/sdk": "^1.12.1",

0 commit comments

Comments
 (0)