Skip to content

Commit 1f4df4f

Browse files
committed
test(cli): assert agent JSON non-sanitization without path equality
1 parent d5e1969 commit 1f4df4f

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎src/commands/agents.commands.list.test.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,10 @@ describe("agentsListCommand", () => {
180180
const jsonRuntime = createRuntime();
181181
await agentsListCommand({ json: true }, jsonRuntime);
182182

183-
expect(jsonRuntime.json[0]).toEqual([
184-
expect.objectContaining({ identityName, workspace, model }),
185-
]);
183+
// Workspace paths are platform-normalized before JSON, so assert the
184+
// non-sanitization invariant on it rather than byte equality.
185+
expect(jsonRuntime.json[0]).toEqual([expect.objectContaining({ identityName, model })]);
186+
expect((jsonRuntime.json[0] as Array<{ workspace: string }>)[0]?.workspace).toContain(control);
186187
});
187188

188189
it.skipIf(process.platform !== "win32")(

0 commit comments

Comments
 (0)