fix(qa): reject short flag gateway smoke values · openclaw/openclaw@3bae0d6
vincentkoc
·
2026-06-22
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -203,6 +203,26 @@ describe("gateway-smoke", () => {
|
203 | 203 | expect(result.stderr.trim()).toBe("Unknown argument: --wat"); |
204 | 204 | }); |
205 | 205 | |
| 206 | +it("rejects option-looking CLI values before connecting", () => { |
| 207 | +for (const [flag, args] of [ |
| 208 | +["--url", ["--url", "-h", "--token", "token"]], |
| 209 | +["--token", ["--url", "ws://127.0.0.1:9", "--token", "-h"]], |
| 210 | +] as const) { |
| 211 | +const result = spawnSync( |
| 212 | +process.execPath, |
| 213 | +["--import", "tsx", "scripts/dev/gateway-smoke.ts", ...args], |
| 214 | +{ |
| 215 | +cwd: process.cwd(), |
| 216 | +encoding: "utf8", |
| 217 | +}, |
| 218 | +); |
| 219 | + |
| 220 | +expect(result.status).toBe(1); |
| 221 | +expect(result.stdout).toBe(""); |
| 222 | +expect(result.stderr.trim()).toBe(`${flag} requires a value`); |
| 223 | +} |
| 224 | +}); |
| 225 | + |
206 | 226 | it("passes against a loopback gateway websocket using the real client", async () => { |
207 | 227 | const stdout: string[] = []; |
208 | 228 | const stderr: string[] = []; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。