test(release): respect stable ClawHub channel

This commit is contained in:
Peter Steinberger
2026-05-21 19:45:12 +01:00
parent cabb55380f
commit 8aabb79a83

View File

@@ -3,7 +3,10 @@ import os from "node:os";
import path from "node:path";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { resolveRegistryUpdateChannel } from "../../../infra/update-channels.js";
import { resolveNpmInstallSpecsForUpdateChannel } from "../../../plugins/install-channel-specs.js";
import {
resolveClawHubInstallSpecsForUpdateChannel,
resolveNpmInstallSpecsForUpdateChannel,
} from "../../../plugins/install-channel-specs.js";
import { VERSION } from "../../../version.js";
function expectedNpmInstallSpec(spec: string): string {
@@ -13,6 +16,13 @@ function expectedNpmInstallSpec(spec: string): string {
}).installSpec;
}
function expectedClawHubInstallSpec(spec: string): string {
return resolveClawHubInstallSpecsForUpdateChannel({
spec,
updateChannel: resolveRegistryUpdateChannel({ currentVersion: VERSION }),
}).installSpec;
}
function expectRecordFields(record: unknown, expected: Record<string, unknown>) {
if (!record || typeof record !== "object") {
throw new Error("Expected record");
@@ -1264,7 +1274,7 @@ describe("repairMissingConfiguredPluginInstalls", () => {
});
expectRecordFields(mockCallArg(mocks.installPluginFromClawHub), {
spec: "clawhub:@openclaw/whatsapp",
spec: expectedClawHubInstallSpec("clawhub:@openclaw/whatsapp"),
env: {
OPENCLAW_COMPATIBILITY_HOST_VERSION: "2026.5.19",
OPENCLAW_UPDATE_POST_CORE_CONVERGENCE: "1",