fix(cli): fix flaky config set help text test caused by env var leaka… · openclaw/openclaw@d124c5a
medns
·
2026-05-19
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1224,14 +1224,13 @@ describe("config cli", () => {
|
1224 | 1224 | expect(helpText).toContain("--batch-json"); |
1225 | 1225 | expect(helpText).toContain("--dry-run"); |
1226 | 1226 | expect(helpText).toContain("--allow-exec"); |
1227 | | -expect(helpText).toContain("openclaw config set gateway.port 19001 --strict-json"); |
1228 | | -expect(helpText).toContain( |
1229 | | -"openclaw config set channels.discord.token --ref-provider default --ref-source", |
1230 | | -); |
1231 | | -expect(helpText).toContain("--ref-id DISCORD_BOT_TOKEN"); |
1232 | | -expect(helpText).toContain( |
1233 | | -"openclaw config set --batch-file ./config-set.batch.json --dry-run", |
| 1227 | +// Ignore Commander line wrapping and env-injected CLI prefixes. |
| 1228 | +const normalizedHelp = helpText.replace(/\s+/g, " "); |
| 1229 | +expect(normalizedHelp).toContain("config set gateway.port 19001 --strict-json"); |
| 1230 | +expect(normalizedHelp).toContain( |
| 1231 | +"channels.discord.token --ref-provider default --ref-source env --ref-id DISCORD_BOT_TOKEN", |
1234 | 1232 | ); |
| 1233 | +expect(normalizedHelp).toContain("--batch-file ./config-set.batch.json --dry-run"); |
1235 | 1234 | }); |
1236 | 1235 | }); |
1237 | 1236 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。