




























@@ -223,6 +223,33 @@ describe("gateway-smoke", () => {
223223}
224224});
225225226+it("rejects duplicate CLI args before connecting", () => {
227+for (const [flag, args] of [
228+[
229+"--url",
230+["--url", "ws://127.0.0.1:9", "--url", "ws://127.0.0.1:10", "--token", "token"],
231+],
232+[
233+"--token",
234+["--url", "ws://127.0.0.1:9", "--token", "one", "--token", "two"],
235+],
236+["--help", ["--help", "--help"]],
237+] as const) {
238+const result = spawnSync(
239+process.execPath,
240+["--import", "tsx", "scripts/dev/gateway-smoke.ts", ...args],
241+{
242+cwd: process.cwd(),
243+encoding: "utf8",
244+},
245+);
246+247+expect(result.status).toBe(1);
248+expect(result.stdout).toBe("");
249+expect(result.stderr.trim()).toBe(`${flag} was provided more than once`);
250+}
251+});
252+226253it("passes against a loopback gateway websocket using the real client", async () => {
227254const stdout: string[] = [];
228255const stderr: string[] = [];
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。