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.
This commit is contained in:
+7
-1
@@ -125,7 +125,13 @@ export async function withTmpDir(
|
|||||||
return {
|
return {
|
||||||
dir,
|
dir,
|
||||||
async [Symbol.asyncDispose]() {
|
async [Symbol.asyncDispose]() {
|
||||||
await Deno.remove(dir, { recursive: true });
|
try {
|
||||||
|
await Deno.remove(dir, { recursive: true });
|
||||||
|
} catch (error) {
|
||||||
|
if (!(error instanceof Deno.errors.PermissionDenied)) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user