Skip to content

Commit 4c548e8

Browse files
author
cod1k
committed
Enhance cleanup handling in e2e test runner
Use the "force" option with recursive directory removal to avoid errors. Wrap the cleanup call in a try-catch to handle potential rejections and log errors gracefully. This improves reliability during the test cleanup process.
1 parent 877f4f0 commit 4c548e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dev-packages/e2e-tests/run.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ async function run(): Promise<void> {
4545
const cleanup = async (): Promise<void> => {
4646
if (tempDirs.size > 0) {
4747
for (const dir of tempDirs) {
48-
await rm(dir, { recursive: true });
48+
await rm(dir, { recursive: true, force: true });
4949
}
5050
}
5151
}
52-
process.once('beforeExit', cleanup);
52+
process.once('beforeExit', () => cleanup().catch(console.error));
5353

5454
// Allow to run a single app only via `yarn test:run <app-name>`
5555
const appName = process.argv[2] || '';

0 commit comments

Comments
 (0)