Skip to content

Commit 5756289

Browse files
committed
Fix qltest-discovery test after tmp upgrade
1 parent 9f0a5f0 commit 5756289

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

extensions/ql-vscode/test/vscode-tests/minimal-workspace/query-testing/qltest-discovery.test.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Uri } from "vscode";
33
import { remove } from "fs-extra";
44
import { join } from "path";
55

6+
import { isIOError } from "../../../../src/common/files";
67
import { QLTestDiscovery } from "../../../../src/query-testing/qltest-discovery";
78
import type { DirectoryResult } from "tmp-promise";
89
import { dir } from "tmp-promise";
@@ -49,7 +50,15 @@ describe("qltest-discovery", () => {
4950
});
5051

5152
afterEach(async () => {
52-
await directory.cleanup();
53+
try {
54+
await directory.cleanup();
55+
} catch (e) {
56+
if (isIOError(e) && e.code === "ENOENT") {
57+
// This is fine, the directory was already removed
58+
} else {
59+
throw e;
60+
}
61+
}
5362
});
5463

5564
it("should run discovery", async () => {

0 commit comments

Comments
 (0)