Skip to content

Commit da472e0

Browse files
committed
test: type acp cli option mock assertions
1 parent 4ec7077 commit da472e0

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

src/cli/acp-cli.option-collisions.test.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ describe("acp cli option collisions", () => {
6868
});
6969

7070
expect(runAcpClientInteractive).toHaveBeenCalledTimes(1);
71-
expect(runAcpClientInteractive.mock.calls[0]?.[0]?.verbose).toBe(true);
71+
const clientOptions = runAcpClientInteractive.mock.calls[0]?.[0] as
72+
| { verbose?: boolean }
73+
| undefined;
74+
expect(clientOptions?.verbose).toBe(true);
7275
});
7376

7477
it("loads gateway token/password from files", async () => {
@@ -87,7 +90,9 @@ describe("acp cli option collisions", () => {
8790
);
8891

8992
expect(serveAcpGateway).toHaveBeenCalledTimes(1);
90-
const [gatewayOptions] = serveAcpGateway.mock.calls[0] ?? [];
93+
const gatewayOptions = serveAcpGateway.mock.calls[0]?.[0] as
94+
| { gatewayPassword?: string; gatewayToken?: string }
95+
| undefined;
9196
expect(gatewayOptions?.gatewayToken).toBe("tok_file");
9297
expect(gatewayOptions?.gatewayPassword).toBe("pw_file"); // pragma: allowlist secret
9398
});
@@ -136,7 +141,10 @@ describe("acp cli option collisions", () => {
136141
});
137142

138143
expect(serveAcpGateway).toHaveBeenCalledTimes(1);
139-
expect(serveAcpGateway.mock.calls[0]?.[0]?.gatewayToken).toBe("tok_file");
144+
const gatewayOptions = serveAcpGateway.mock.calls[0]?.[0] as
145+
| { gatewayToken?: string }
146+
| undefined;
147+
expect(gatewayOptions?.gatewayToken).toBe("tok_file");
140148
});
141149

142150
it("reports missing token-file read errors", async () => {

0 commit comments

Comments
 (0)