






























@@ -170,6 +170,26 @@ describe("gateway register option collisions", () => {
170170expect(runtime).toBe(defaultRuntime);
171171},
172172},
173+{
174+name: "passes decimal usage-cost --days values",
175+argv: ["gateway", "usage-cost", "--days", "7", "--json"],
176+assert: () => {
177+expect(callGatewayCli).toHaveBeenCalledTimes(1);
178+const [method, _opts, params] = firstGatewayCall();
179+expect(method).toBe("usage.cost");
180+expect(params).toEqual({ days: 7 });
181+},
182+},
183+{
184+name: "falls back for non-decimal usage-cost --days values",
185+argv: ["gateway", "usage-cost", "--days", "1e3", "--json"],
186+assert: () => {
187+expect(callGatewayCli).toHaveBeenCalledTimes(1);
188+const [method, _opts, params] = firstGatewayCall();
189+expect(method).toBe("usage.cost");
190+expect(params).toEqual({ days: 30 });
191+},
192+},
173193])("$name", async ({ argv, assert }) => {
174194await sharedProgram.parseAsync(argv, { from: "user" });
175195assert();
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。