test: clear openshell broad matchers

This commit is contained in:
Shakker
2026-05-10 16:54:04 +01:00
parent 9c73ff741b
commit 5a3fc79df5
2 changed files with 28 additions and 17 deletions

View File

@@ -46,12 +46,20 @@ describe("openshell plugin config", () => {
remoteWorkspaceDir: "/sandbox/../sandbox/project",
remoteAgentWorkspaceDir: "/agent/./session",
}),
).toEqual(
expect.objectContaining({
remoteWorkspaceDir: "/sandbox/project",
remoteAgentWorkspaceDir: "/agent/session",
}),
);
).toEqual({
mode: "mirror",
command: "openshell",
gateway: undefined,
gatewayEndpoint: undefined,
from: "openclaw",
policy: undefined,
providers: [],
gpu: false,
autoProviders: true,
remoteWorkspaceDir: "/sandbox/project",
remoteAgentWorkspaceDir: "/agent/session",
timeoutMs: 120_000,
});
});
it("rejects unknown mode", () => {

View File

@@ -137,13 +137,15 @@ describe("openshell backend manager", () => {
actualConfigLabel: "custom-source",
configLabelMatch: true,
});
const expectedConfig = resolveOpenShellPluginConfig({
command: "openshell",
from: "custom-source",
});
expect(cliMocks.runOpenShellCli).toHaveBeenCalledWith({
context: expect.objectContaining({
context: {
sandboxName: "openclaw-session-1234",
config: expect.objectContaining({
from: "custom-source",
}),
}),
config: expectedConfig,
},
args: ["sandbox", "get", "openclaw-session-1234"],
});
});
@@ -176,14 +178,15 @@ describe("openshell backend manager", () => {
config: {},
});
const expectedConfig = resolveOpenShellPluginConfig({
command: "/usr/local/bin/openshell",
gateway: "lab",
});
expect(cliMocks.runOpenShellCli).toHaveBeenCalledWith({
context: expect.objectContaining({
context: {
sandboxName: "openclaw-session-5678",
config: expect.objectContaining({
command: "/usr/local/bin/openshell",
gateway: "lab",
}),
}),
config: expectedConfig,
},
args: ["sandbox", "delete", "openclaw-session-5678"],
});
});