@@ -10,7 +10,9 @@ import {
|
10 | 10 | discoverBundledPluginRuntimeDeps, |
11 | 11 | pruneBundledPluginSourceNodeModules, |
12 | 12 | runBundledPluginPostinstall, |
| 13 | +restoreLegacyUpdaterCompatSidecars, |
13 | 14 | } from "../../scripts/postinstall-bundled-plugins.mjs"; |
| 15 | +import { NPM_UPDATE_COMPAT_SIDECARS } from "../../src/infra/npm-update-compat-sidecars.ts"; |
14 | 16 | import { writePackageDistInventory } from "../../src/infra/package-dist-inventory.ts"; |
15 | 17 | import { createScriptTestHarness } from "./test-helpers.js"; |
16 | 18 | |
@@ -308,6 +310,22 @@ describe("bundled plugin postinstall", () => {
|
308 | 310 | ).resolves.toBe("export {};\n"); |
309 | 311 | }); |
310 | 312 | |
| 313 | +it("keeps postinstall QA compat sidecars aligned with update verification metadata", async () => { |
| 314 | +const packageRoot = await createTempDirAsync("openclaw-packaged-install-qa-compat-"); |
| 315 | + |
| 316 | +const restored = restoreLegacyUpdaterCompatSidecars({ |
| 317 | + packageRoot, |
| 318 | +log: { log: vi.fn(), warn: vi.fn() }, |
| 319 | +}); |
| 320 | + |
| 321 | +expect(restored).toEqual(NPM_UPDATE_COMPAT_SIDECARS.map((sidecar) => sidecar.path)); |
| 322 | +for (const sidecar of NPM_UPDATE_COMPAT_SIDECARS) { |
| 323 | +await expect(fs.readFile(path.join(packageRoot, sidecar.path), "utf8")).resolves.toBe( |
| 324 | +sidecar.content, |
| 325 | +); |
| 326 | +} |
| 327 | +}); |
| 328 | + |
311 | 329 | it("keeps packaged postinstall non-fatal when the dist inventory is missing", async () => { |
312 | 330 | const packageRoot = await createTempDirAsync("openclaw-packaged-install-missing-inventory-"); |
313 | 331 | const staleFile = path.join(packageRoot, "dist", "channel-CJUAgRQR.js"); |
|