Skip to content

Commit d124c5a

Browse files
mednsaltaywtf
andauthored
fix(cli): fix flaky config set help text test caused by env var leakage and word wrapping (#83423)
Merged via squash. Prepared head SHA: 7ba1bac Co-authored-by: medns <1575008+medns@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf
1 parent 721ad15 commit d124c5a

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/cli/config-cli.test.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,14 +1224,13 @@ describe("config cli", () => {
12241224
expect(helpText).toContain("--batch-json");
12251225
expect(helpText).toContain("--dry-run");
12261226
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",
12341232
);
1233+
expect(normalizedHelp).toContain("--batch-file ./config-set.batch.json --dry-run");
12351234
});
12361235
});
12371236

0 commit comments

Comments
 (0)