























@@ -1,39 +1,47 @@
11import { describe, expect, it } from "vitest";
22import {
3+type OfficialExternalPluginCatalogEntry,
34getOfficialExternalPluginCatalogEntry,
45listOfficialExternalPluginCatalogEntries,
56resolveOfficialExternalPluginId,
67resolveOfficialExternalPluginInstall,
78} from "./official-external-plugin-catalog.js";
8910+function expectCatalogEntry(id: string): OfficialExternalPluginCatalogEntry {
11+const entry = getOfficialExternalPluginCatalogEntry(id);
12+if (entry === undefined) {
13+throw new Error(`Expected external plugin catalog entry for ${id}`);
14+}
15+return entry;
16+}
17+918describe("official external plugin catalog", () => {
1019it("resolves third-party channel lookup aliases to published plugin ids", () => {
11-const wecomByChannel = getOfficialExternalPluginCatalogEntry("wecom");
12-const wecomByPlugin = getOfficialExternalPluginCatalogEntry("wecom-openclaw-plugin");
13-const yuanbaoByChannel = getOfficialExternalPluginCatalogEntry("yuanbao");
20+const wecomByChannel = expectCatalogEntry("wecom");
21+const wecomByPlugin = expectCatalogEntry("wecom-openclaw-plugin");
22+const yuanbaoByChannel = expectCatalogEntry("yuanbao");
142315-expect(resolveOfficialExternalPluginId(wecomByChannel!)).toBe("wecom-openclaw-plugin");
16-expect(resolveOfficialExternalPluginId(wecomByPlugin!)).toBe("wecom-openclaw-plugin");
17-expect(resolveOfficialExternalPluginInstall(wecomByChannel!)?.npmSpec).toBe(
24+expect(resolveOfficialExternalPluginId(wecomByChannel)).toBe("wecom-openclaw-plugin");
25+expect(resolveOfficialExternalPluginId(wecomByPlugin)).toBe("wecom-openclaw-plugin");
26+expect(resolveOfficialExternalPluginInstall(wecomByChannel)?.npmSpec).toBe(
1827"@wecom/wecom-openclaw-plugin@2026.4.23",
1928);
20-expect(resolveOfficialExternalPluginId(yuanbaoByChannel!)).toBe("openclaw-plugin-yuanbao");
21-expect(resolveOfficialExternalPluginInstall(yuanbaoByChannel!)?.npmSpec).toBe(
29+expect(resolveOfficialExternalPluginId(yuanbaoByChannel)).toBe("openclaw-plugin-yuanbao");
30+expect(resolveOfficialExternalPluginInstall(yuanbaoByChannel)?.npmSpec).toBe(
2231"openclaw-plugin-yuanbao@2.11.0",
2332);
2433});
25342635it("keeps official launch package specs on the production package names", () => {
27-expect(
28-resolveOfficialExternalPluginInstall(getOfficialExternalPluginCatalogEntry("acpx")!)?.npmSpec,
29-).toBe("@openclaw/acpx");
30-expect(
31-resolveOfficialExternalPluginInstall(getOfficialExternalPluginCatalogEntry("googlechat")!)
32-?.npmSpec,
33-).toBe("@openclaw/googlechat");
34-expect(
35-resolveOfficialExternalPluginInstall(getOfficialExternalPluginCatalogEntry("line")!)?.npmSpec,
36-).toBe("@openclaw/line");
36+expect(resolveOfficialExternalPluginInstall(expectCatalogEntry("acpx"))?.npmSpec).toBe(
37+"@openclaw/acpx",
38+);
39+expect(resolveOfficialExternalPluginInstall(expectCatalogEntry("googlechat"))?.npmSpec).toBe(
40+"@openclaw/googlechat",
41+);
42+expect(resolveOfficialExternalPluginInstall(expectCatalogEntry("line"))?.npmSpec).toBe(
43+"@openclaw/line",
44+);
3745});
38463947it("keeps Matrix and Mattermost out of the external catalog until cutover", () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。