test: tighten release metadata guard assertion · openclaw/openclaw@c547427
shakkernerd
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -17,6 +17,7 @@ import { cleanupTempDirs, makeTempRepoRoot } from "../helpers/temp-repo.js";
|
17 | 17 | |
18 | 18 | const tempDirs: string[] = []; |
19 | 19 | const repoRoot = process.cwd(); |
| 20 | +type ExecFileSyncFailure = Error & { status?: number | null; stderr?: Buffer }; |
20 | 21 | const nestedGitEnvKeys = [ |
21 | 22 | "GIT_ALTERNATE_OBJECT_DIRECTORIES", |
22 | 23 | "GIT_DIR", |
@@ -799,7 +800,8 @@ describe("scripts/changed-lanes", () => {
|
799 | 800 | "utf8", |
800 | 801 | ); |
801 | 802 | git(dir, ["add", "package.json"]); |
802 | | -expect(() => |
| 803 | +let failure: ExecFileSyncFailure | undefined; |
| 804 | +try { |
803 | 805 | execFileSync( |
804 | 806 | process.execPath, |
805 | 807 | [path.join(repoRoot, "scripts", "check-release-metadata-only.mjs"), "--staged"], |
@@ -808,8 +810,15 @@ describe("scripts/changed-lanes", () => {
|
808 | 810 | env: createNestedGitEnv(), |
809 | 811 | stdio: "pipe", |
810 | 812 | }, |
811 | | -), |
812 | | -).toThrow(); |
| 813 | +); |
| 814 | +} catch (error) { |
| 815 | +failure = error as ExecFileSyncFailure; |
| 816 | +} |
| 817 | + |
| 818 | +expect(failure?.status).toBe(1); |
| 819 | +expect(failure?.stderr?.toString("utf8")).toContain( |
| 820 | +"[release-metadata] package.json changed outside the top-level version field", |
| 821 | +); |
813 | 822 | }); |
814 | 823 | |
815 | 824 | it("routes root test/support changes to the tooling test lane instead of all lanes", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。