1 import * as path from "path";
2 import * as fs from "fs";
4 import { runTests } from "@vscode/test-electron";
6 async function main() {
7 // The folder containing the Extension Manifest package.json
8 // Passed to `--extensionDevelopmentPath`
9 const extensionDevelopmentPath = path.resolve(__dirname, "../../");
11 // Minimum supported version.
12 const jsonData = fs.readFileSync(path.join(extensionDevelopmentPath, "package.json"));
13 const json = JSON.parse(jsonData.toString());
14 let minimalVersion: string = json.engines.vscode;
15 if (minimalVersion.startsWith("^")) minimalVersion = minimalVersion.slice(1);
17 const launchArgs = ["--disable-extensions", extensionDevelopmentPath];
19 // All test suites (either unit tests or integration tests) should be in subfolders.
20 const extensionTestsPath = path.resolve(__dirname, "./unit/index");
22 // Run tests using the minimal supported version.
24 version: minimalVersion,
26 extensionDevelopmentPath,
34 extensionDevelopmentPath,
39 main().catch((err) => {
40 // eslint-disable-next-line no-console
41 console.error("Failed to run tests", err);