Skip to content

Commit cfc9a9a

Browse files
chore: ensures more stable CI runs on Windows environments. (#3070)
This pull request includes a small but important change to the `withTmpDir` function in `src/test_utils.ts`. The change adds error handling to ensure that a `PermissionDenied` error during directory removal does not interrupt the execution.
1 parent 31434a2 commit cfc9a9a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/test_utils.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,13 @@ export async function withTmpDir(
125125
return {
126126
dir,
127127
async [Symbol.asyncDispose]() {
128-
await Deno.remove(dir, { recursive: true });
128+
try {
129+
await Deno.remove(dir, { recursive: true });
130+
} catch (error) {
131+
if (!(error instanceof Deno.errors.PermissionDenied)) {
132+
throw error;
133+
}
134+
}
129135
},
130136
};
131137
}

0 commit comments

Comments
 (0)