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>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
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);
|
||||
});
|
||||
Reference in New Issue
Block a user