mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-28 13:26:04 -06:00
fix(cli): fix flaky config set help text test caused by env var leakage and word wrapping (#83423)
Merged via squash.
Prepared head SHA: 7ba1bac70c
Co-authored-by: medns <1575008+medns@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
This commit is contained in:
@@ -1224,14 +1224,13 @@ describe("config cli", () => {
|
||||
expect(helpText).toContain("--batch-json");
|
||||
expect(helpText).toContain("--dry-run");
|
||||
expect(helpText).toContain("--allow-exec");
|
||||
expect(helpText).toContain("openclaw config set gateway.port 19001 --strict-json");
|
||||
expect(helpText).toContain(
|
||||
"openclaw config set channels.discord.token --ref-provider default --ref-source",
|
||||
);
|
||||
expect(helpText).toContain("--ref-id DISCORD_BOT_TOKEN");
|
||||
expect(helpText).toContain(
|
||||
"openclaw config set --batch-file ./config-set.batch.json --dry-run",
|
||||
// Ignore Commander line wrapping and env-injected CLI prefixes.
|
||||
const normalizedHelp = helpText.replace(/\s+/g, " ");
|
||||
expect(normalizedHelp).toContain("config set gateway.port 19001 --strict-json");
|
||||
expect(normalizedHelp).toContain(
|
||||
"channels.discord.token --ref-provider default --ref-source env --ref-id DISCORD_BOT_TOKEN",
|
||||
);
|
||||
expect(normalizedHelp).toContain("--batch-file ./config-set.batch.json --dry-run");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user