@@ -69,6 +69,64 @@ describe("parseCliProfileArgs", () => {
|
69 | 69 | expect(res.argv).toEqual(["node", "openclaw", "status", "--deep"]); |
70 | 70 | }); |
71 | 71 | |
| 72 | +it("preserves Matrix QA --profile for the command parser", () => { |
| 73 | +const res = parseCliProfileArgs([ |
| 74 | +"node", |
| 75 | +"openclaw", |
| 76 | +"qa", |
| 77 | +"matrix", |
| 78 | +"--profile", |
| 79 | +"fast", |
| 80 | +"--fail-fast", |
| 81 | +]); |
| 82 | +if (!res.ok) { |
| 83 | +throw new Error(res.error); |
| 84 | +} |
| 85 | +expect(res.profile).toBeNull(); |
| 86 | +expect(res.argv).toEqual([ |
| 87 | +"node", |
| 88 | +"openclaw", |
| 89 | +"qa", |
| 90 | +"matrix", |
| 91 | +"--profile", |
| 92 | +"fast", |
| 93 | +"--fail-fast", |
| 94 | +]); |
| 95 | +}); |
| 96 | + |
| 97 | +it("preserves Matrix QA --profile after leading root options", () => { |
| 98 | +const res = parseCliProfileArgs([ |
| 99 | +"node", |
| 100 | +"openclaw", |
| 101 | +"--no-color", |
| 102 | +"qa", |
| 103 | +"matrix", |
| 104 | +"--profile=fast", |
| 105 | +]); |
| 106 | +if (!res.ok) { |
| 107 | +throw new Error(res.error); |
| 108 | +} |
| 109 | +expect(res.profile).toBeNull(); |
| 110 | +expect(res.argv).toEqual(["node", "openclaw", "--no-color", "qa", "matrix", "--profile=fast"]); |
| 111 | +}); |
| 112 | + |
| 113 | +it("still parses root --profile before Matrix QA", () => { |
| 114 | +const res = parseCliProfileArgs([ |
| 115 | +"node", |
| 116 | +"openclaw", |
| 117 | +"--profile", |
| 118 | +"work", |
| 119 | +"qa", |
| 120 | +"matrix", |
| 121 | +"--fail-fast", |
| 122 | +]); |
| 123 | +if (!res.ok) { |
| 124 | +throw new Error(res.error); |
| 125 | +} |
| 126 | +expect(res.profile).toBe("work"); |
| 127 | +expect(res.argv).toEqual(["node", "openclaw", "qa", "matrix", "--fail-fast"]); |
| 128 | +}); |
| 129 | + |
72 | 130 | it("parses interleaved --dev after the command token", () => { |
73 | 131 | const res = parseCliProfileArgs(["node", "openclaw", "status", "--dev"]); |
74 | 132 | if (!res.ok) { |
|