test(scripts): route extensionless helper scripts · openclaw/openclaw@b2d78ab
vincentkoc
·
2026-06-21
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | // Gh Read tests cover gh read script behavior. |
| 2 | +import { execFileSync } from "node:child_process"; |
2 | 3 | import { afterEach, describe, expect, it, vi } from "vitest"; |
3 | 4 | import { |
4 | 5 | buildReadPermissions, |
@@ -16,6 +17,22 @@ describe("gh-read helpers", () => {
|
16 | 17 | vi.useRealTimers(); |
17 | 18 | }); |
18 | 19 | |
| 20 | +it("prints wrapper usage before reading auth env", () => { |
| 21 | +let stderr = ""; |
| 22 | +try { |
| 23 | +execFileSync("bash", ["scripts/gh-read"], { |
| 24 | +cwd: process.cwd(), |
| 25 | +encoding: "utf8", |
| 26 | +stdio: ["ignore", "pipe", "pipe"], |
| 27 | +}); |
| 28 | +} catch (error) { |
| 29 | +stderr = String((error as { stderr?: unknown }).stderr ?? error); |
| 30 | +} |
| 31 | + |
| 32 | +expect(stderr).toContain("usage: scripts/gh-read <gh args...>"); |
| 33 | +expect(stderr).toContain("OPENCLAW_GH_READ_APP_ID"); |
| 34 | +}); |
| 35 | + |
19 | 36 | it("finds repo from gh args", () => { |
20 | 37 | expect(parseRepoArg(["pr", "view", "42", "-R", "openclaw/openclaw"])).toBe("openclaw/openclaw"); |
21 | 38 | expect(parseRepoArg(["run", "list", "--repo=openclaw/docs"])).toBe("openclaw/docs"); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。