test: dedupe runtime postbuild absence assertions · openclaw/openclaw@4c06dee
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -14,6 +14,10 @@ import { createScriptTestHarness } from "./test-helpers.js";
|
14 | 14 | |
15 | 15 | const { createTempDir } = createScriptTestHarness(); |
16 | 16 | |
| 17 | +async function expectPathMissing(targetPath: string): Promise<void> { |
| 18 | +await expect(fs.stat(targetPath)).rejects.toMatchObject({ code: "ENOENT" }); |
| 19 | +} |
| 20 | + |
17 | 21 | describe("runtime postbuild static assets", () => { |
18 | 22 | it("tracks plugin-owned static assets that release packaging must ship", () => { |
19 | 23 | expect(listStaticExtensionAssetOutputs()).toEqual( |
@@ -117,7 +121,7 @@ describe("runtime postbuild static assets", () => {
|
117 | 121 | expect(await fs.readFile(path.join(distDir, "runtime-tts.runtime.js"), "utf8")).toBe( |
118 | 122 | 'export * from "./runtime-tts.runtime-AbCd1234.js";\n', |
119 | 123 | ); |
120 | | -await expect(fs.stat(path.join(distDir, "library.js"))).rejects.toThrow(); |
| 124 | +await expectPathMissing(path.join(distDir, "library.js")); |
121 | 125 | }); |
122 | 126 | |
123 | 127 | it("does not write ambiguous stable aliases for colliding root runtime chunks", async () => { |
@@ -142,7 +146,7 @@ describe("runtime postbuild static assets", () => {
|
142 | 146 | |
143 | 147 | writeStableRootRuntimeAliases({ rootDir }); |
144 | 148 | |
145 | | -await expect(fs.stat(path.join(distDir, "install.runtime.js"))).rejects.toThrow(); |
| 149 | +await expectPathMissing(path.join(distDir, "install.runtime.js")); |
146 | 150 | }); |
147 | 151 | |
148 | 152 | it("writes a stable plugin install runtime alias when install runtimes collide", async () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。