@@ -145,25 +145,21 @@ describe("gateway register option collisions", () => {
|
145 | 145 | name: "forwards --token to gateway call when parent and child option names collide", |
146 | 146 | argv: ["gateway", "call", "health", "--token", "tok_call", "--json"], |
147 | 147 | assert: () => { |
148 | | -expect(callGatewayCli).toHaveBeenCalledWith( |
149 | | -"health", |
150 | | -expect.objectContaining({ |
151 | | -token: "tok_call", |
152 | | -}), |
153 | | -{}, |
154 | | -); |
| 148 | +expect(callGatewayCli).toHaveBeenCalledTimes(1); |
| 149 | +const [method, opts, params] = callGatewayCli.mock.calls[0] ?? []; |
| 150 | +expect(method).toBe("health"); |
| 151 | +expect((opts as { token?: string } | undefined)?.token).toBe("tok_call"); |
| 152 | +expect(params).toEqual({}); |
155 | 153 | }, |
156 | 154 | }, |
157 | 155 | { |
158 | 156 | name: "forwards --token to gateway probe when parent and child option names collide", |
159 | 157 | argv: ["gateway", "probe", "--token", "tok_probe", "--json"], |
160 | 158 | assert: () => { |
161 | | -expect(gatewayStatusCommand).toHaveBeenCalledWith( |
162 | | -expect.objectContaining({ |
163 | | -token: "tok_probe", |
164 | | -}), |
165 | | -defaultRuntime, |
166 | | -); |
| 159 | +expect(gatewayStatusCommand).toHaveBeenCalledTimes(1); |
| 160 | +const [opts, runtime] = gatewayStatusCommand.mock.calls[0] ?? []; |
| 161 | +expect((opts as { token?: string } | undefined)?.token).toBe("tok_probe"); |
| 162 | +expect(runtime).toBe(defaultRuntime); |
167 | 163 | }, |
168 | 164 | }, |
169 | 165 | ])("$name", async ({ argv, assert }) => { |
|