test(acpx): cover Windows extension test paths

This commit is contained in:
Vincent Koc
2026-05-04 04:20:30 -07:00
parent c1da0ddd54
commit 03d04c243b
3 changed files with 15 additions and 7 deletions

View File

@@ -56,13 +56,20 @@ function generatedClaudePaths(stateDir: string): {
}
function expectCodexWrapperCommand(command: string | undefined, wrapperPath: string): void {
expect(command).toContain(process.execPath);
expect(command).toContain(wrapperPath);
expect(command).toContain(quoteArg(process.execPath));
expect(command).toContain(quoteArg(wrapperPath));
}
function expectClaudeWrapperCommand(command: string | undefined, wrapperPath: string): void {
expect(command).toContain(process.execPath);
expect(command).toContain(wrapperPath);
expect(command).toContain(quoteArg(process.execPath));
expect(command).toContain(quoteArg(wrapperPath));
}
function expectWrapperToContainPathSuffix(wrapper: string, pathSuffix: string[]): void {
const nativeSuffix = pathSuffix.join(path.sep);
const escapedNativeSuffix = JSON.stringify(nativeSuffix).slice(1, -1);
const posixSuffix = pathSuffix.join("/");
expect(wrapper.includes(escapedNativeSuffix) || wrapper.includes(posixSuffix)).toBe(true);
}
afterEach(async () => {
@@ -199,7 +206,7 @@ describe("prepareAcpxCodexAuthConfig", () => {
const wrapper = await fs.readFile(generated.wrapperPath, "utf8");
expect(wrapper).toContain("@zed-industries/codex-acp");
expect(wrapper).toContain("bin/codex-acp.js");
expectWrapperToContainPathSuffix(wrapper, ["bin", "codex-acp.js"]);
expect(wrapper).toContain("defaultArgs = [installedBinPath]");
});
@@ -219,7 +226,7 @@ describe("prepareAcpxCodexAuthConfig", () => {
const wrapper = await fs.readFile(generated.wrapperPath, "utf8");
expect(wrapper).toContain("@agentclientprotocol/claude-agent-acp");
expect(wrapper).toContain("dist/index.js");
expectWrapperToContainPathSuffix(wrapper, ["dist", "index.js"]);
expect(wrapper).toContain("defaultArgs = [installedBinPath]");
});

View File

@@ -5,7 +5,7 @@ import { resolveAcpxPluginConfig, resolveAcpxPluginRoot } from "./config.js";
describe("embedded acpx plugin config", () => {
it("resolves workspace stateDir and cwd by default", () => {
const workspaceDir = "/tmp/openclaw-acpx";
const workspaceDir = path.resolve("/tmp/openclaw-acpx");
const resolved = resolveAcpxPluginConfig({
rawConfig: undefined,
workspaceDir,

View File

@@ -303,6 +303,7 @@ export const sharedVitestConfig = {
"**/node_modules/**",
"**/vendor/**",
"dist/OpenClaw.app/**",
"**/._*",
"**/*.live.test.ts",
"**/*.e2e.test.ts",
],