runa/vscode/scripts/test-host.cjs

31 lines
1002 B
JavaScript

const path = require("node:path");
const fs = require("node:fs");
const { runTests } = require("@vscode/test-electron");
// Adding the image source folder to an empty or single-folder window restarts the
// extension host, so tests start in a multi-root workspace with one local folder.
const root = path.resolve(__dirname, "..");
const workspaceFile = path.join(root, ".vscode-test", "runa-host.code-workspace");
fs.mkdirSync(path.dirname(workspaceFile), { recursive: true });
fs.writeFileSync(
workspaceFile,
JSON.stringify({ folders: [{ path: path.join(root, "integration") }] }, null, 2),
);
runTests({
version: "1.96.4",
extensionDevelopmentPath: path.resolve(__dirname, ".."),
extensionTestsPath: path.resolve(__dirname, "../out/integration/host.js"),
launchArgs: [
workspaceFile,
"--disable-gpu",
"--no-sandbox",
"--skip-welcome",
"--disable-extensions",
"--disable-telemetry",
],
}).catch((error) => {
console.error(error);
process.exitCode = 1;
});