mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:30:42 +00:00
test(acpx): cover Windows extension test paths
This commit is contained in:
@@ -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]");
|
||||
});
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -303,6 +303,7 @@ export const sharedVitestConfig = {
|
||||
"**/node_modules/**",
|
||||
"**/vendor/**",
|
||||
"dist/OpenClaw.app/**",
|
||||
"**/._*",
|
||||
"**/*.live.test.ts",
|
||||
"**/*.e2e.test.ts",
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user