Skip to content

Commit e0244b8

Browse files
committed
Update runTest.ts
1 parent 96621b9 commit e0244b8

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

test/runTest.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import * as path from "path";
44
import { runTests } from "@vscode/test-electron";
55

66
async function main() {
7+
const tempRoot = fs.mkdtempSync(
8+
path.join(os.tmpdir(), "vscode-htmlhint-tests-"),
9+
);
10+
711
try {
812
// The folder containing the Extension Manifest package.json
913
// Passed to `--extensionDevelopmentPath`
@@ -12,9 +16,6 @@ async function main() {
1216
// The path to the test runner
1317
// Passed to --extensionTestsPath
1418
const extensionTestsPath = path.resolve(__dirname, "./suite/index");
15-
const tempRoot = fs.mkdtempSync(
16-
path.join(os.tmpdir(), "vscode-htmlhint-tests-"),
17-
);
1819
const extensionTestsEnvPath = path.join(tempRoot, "extensions");
1920
const userDataDir = path.join(tempRoot, "user-data");
2021
const extensionPackageJsonPath = path.resolve(
@@ -50,6 +51,8 @@ async function main() {
5051
} catch (err) {
5152
console.error("Failed to run tests", err);
5253
process.exit(1);
54+
} finally {
55+
fs.rmSync(tempRoot, { recursive: true, force: true });
5356
}
5457
}
5558

0 commit comments

Comments
 (0)