



























@@ -56,13 +56,20 @@ function generatedClaudePaths(stateDir: string): {
5656}
57575858function expectCodexWrapperCommand(command: string | undefined, wrapperPath: string): void {
59-expect(command).toContain(process.execPath);
60-expect(command).toContain(wrapperPath);
59+expect(command).toContain(quoteArg(process.execPath));
60+expect(command).toContain(quoteArg(wrapperPath));
6161}
62626363function expectClaudeWrapperCommand(command: string | undefined, wrapperPath: string): void {
64-expect(command).toContain(process.execPath);
65-expect(command).toContain(wrapperPath);
64+expect(command).toContain(quoteArg(process.execPath));
65+expect(command).toContain(quoteArg(wrapperPath));
66+}
67+68+function expectWrapperToContainPathSuffix(wrapper: string, pathSuffix: string[]): void {
69+const nativeSuffix = pathSuffix.join(path.sep);
70+const escapedNativeSuffix = JSON.stringify(nativeSuffix).slice(1, -1);
71+const posixSuffix = pathSuffix.join("/");
72+expect(wrapper.includes(escapedNativeSuffix) || wrapper.includes(posixSuffix)).toBe(true);
6673}
67746875afterEach(async () => {
@@ -199,7 +206,7 @@ describe("prepareAcpxCodexAuthConfig", () => {
199206200207const wrapper = await fs.readFile(generated.wrapperPath, "utf8");
201208expect(wrapper).toContain("@zed-industries/codex-acp");
202-expect(wrapper).toContain("bin/codex-acp.js");
209+expectWrapperToContainPathSuffix(wrapper, ["bin", "codex-acp.js"]);
203210expect(wrapper).toContain("defaultArgs = [installedBinPath]");
204211});
205212@@ -219,7 +226,7 @@ describe("prepareAcpxCodexAuthConfig", () => {
219226220227const wrapper = await fs.readFile(generated.wrapperPath, "utf8");
221228expect(wrapper).toContain("@agentclientprotocol/claude-agent-acp");
222-expect(wrapper).toContain("dist/index.js");
229+expectWrapperToContainPathSuffix(wrapper, ["dist", "index.js"]);
223230expect(wrapper).toContain("defaultArgs = [installedBinPath]");
224231});
225232此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。