@@ -7,26 +7,28 @@ describe("formatCliParseErrorOutput", () => {
|
7 | 7 | argv: ["node", "openclaw", "wat"], |
8 | 8 | }); |
9 | 9 | |
10 | | -expect(output).toContain('OpenClaw does not know the command "wat".'); |
11 | | -expect(output).toContain("openclaw --help"); |
12 | | -expect(output).toContain("openclaw plugins list"); |
| 10 | +expect(output).toBe( |
| 11 | + 'OpenClaw does not know the command "wat".\nTry: openclaw --help\nPlugin command? openclaw plugins list\nDocs: https://docs.openclaw.ai/cli\n', |
| 12 | +); |
13 | 13 | }); |
14 | 14 | |
15 | 15 | it("points unknown options at the active command help", () => { |
16 | 16 | const output = formatCliParseErrorOutput("error: unknown option '--wat'\n", { |
17 | 17 | argv: ["node", "openclaw", "channels", "status", "--wat"], |
18 | 18 | }); |
19 | 19 | |
20 | | -expect(output).toContain('OpenClaw does not recognize option "--wat".'); |
21 | | -expect(output).toContain("openclaw channels status --help"); |
| 20 | +expect(output).toBe( |
| 21 | +'OpenClaw does not recognize option "--wat".\nTry: openclaw channels status --help\n', |
| 22 | +); |
22 | 23 | }); |
23 | 24 | |
24 | 25 | it("points missing required arguments at command help", () => { |
25 | 26 | const output = formatCliParseErrorOutput("error: missing required argument 'name'\n", { |
26 | 27 | argv: ["node", "openclaw", "plugins", "install"], |
27 | 28 | }); |
28 | 29 | |
29 | | -expect(output).toContain('Missing required argument "name".'); |
30 | | -expect(output).toContain("openclaw plugins install --help"); |
| 30 | +expect(output).toBe( |
| 31 | +'Missing required argument "name".\nTry: openclaw plugins install --help\n', |
| 32 | +); |
31 | 33 | }); |
32 | 34 | }); |