Files
vscode-cowriting-plugin/test/e2e/runTest.ts
T
Ben Stull 4ce6c9da52 F2 SLICE-5: @vscode/test-electron host E2E (create→reload→re-anchor→orphan) (#4)
Drives the extension's returned ThreadController API + asserts the on-disk
sidecar and rendered Comments state (spec §6.8 fallback). All 4 host tests
green against VS Code 1.124.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 06:58:51 -07:00

32 lines
1011 B
TypeScript

import * as path from "path";
import * as os from "os";
import * as fs from "fs";
import { runTests } from "@vscode/test-electron";
async function main(): Promise<void> {
const projectRoot = path.resolve(__dirname, "../../../");
const extensionDevelopmentPath = projectRoot;
const extensionTestsPath = path.resolve(__dirname, "./suite/index");
// Copy the fixture workspace to a temp dir so test writes are throwaway.
const fixture = path.resolve(projectRoot, "test/e2e/fixtures/workspace");
const workspace = fs.mkdtempSync(path.join(os.tmpdir(), "cowriting-e2e-"));
fs.cpSync(fixture, workspace, { recursive: true });
try {
await runTests({
extensionDevelopmentPath,
extensionTestsPath,
launchArgs: [workspace, "--disable-extensions"],
extensionTestsEnv: { E2E_WORKSPACE: workspace },
});
} finally {
fs.rmSync(workspace, { recursive: true, force: true });
}
}
main().catch((err) => {
console.error("E2E run failed:", err);
process.exit(1);
});