fix(e2e): reject help flag Crabbox proof values · openclaw/openclaw@b95b725
vincentkoc
·
2026-06-22
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -9,6 +9,7 @@ import { afterEach, describe, expect, it, vi } from "vitest";
|
9 | 9 | import { |
10 | 10 | COMMAND_TIMEOUT_MS, |
11 | 11 | createOpenClawGatewaySpawnSpec, |
| 12 | +parseArgs, |
12 | 13 | readLogTail, |
13 | 14 | readTelegramUserProofLogTailBytes, |
14 | 15 | recordProbeVideo, |
@@ -143,6 +144,18 @@ describe("telegram user Crabbox proof log polling", () => {
|
143 | 144 | expect(highMockPort.stderr).toContain("--mock-port must be a TCP port from 1 to 65535."); |
144 | 145 | }); |
145 | 146 | |
| 147 | +it("rejects short flags as proof option values before dry-run planning", () => { |
| 148 | +const result = runProofCli(["--output-dir", "-h", "--dry-run"]); |
| 149 | + |
| 150 | +expect(result.status).toBe(1); |
| 151 | +expect(result.stderr).toContain("Usage:"); |
| 152 | +expect(result.stdout).toBe(""); |
| 153 | +}); |
| 154 | + |
| 155 | +it("keeps hyphen-prefixed free-text proof values", () => { |
| 156 | +expect(parseArgs(["--text", "-ping"]).text).toBe("-ping"); |
| 157 | +}); |
| 158 | + |
146 | 159 | it("reads only the requested log tail", () => { |
147 | 160 | const logPath = path.join(makeTempDir(), "gateway.log"); |
148 | 161 | fs.writeFileSync(logPath, `${"old\n".repeat(2000)}ready\n`, "utf8"); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。