Skip to content

Commit 16763de

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

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
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+
}

0 commit comments

Comments
 (0)