pluginMarketplaces.test.ts 1.2 KB

1234567891011121314151617181920212223242526272829
  1. import { describe, expect, it } from "vitest";
  2. import { DEFAULT_PLUGIN_MARKETPLACES, isPublicStoreMarketplaceId } from "../src/index.js";
  3. describe("DEFAULT_PLUGIN_MARKETPLACES", () => {
  4. it("includes the official CDN marketplace and the Claude official marketplace", () => {
  5. expect(DEFAULT_PLUGIN_MARKETPLACES).toEqual([
  6. expect.objectContaining({
  7. id: "zcode-plugins-official",
  8. name: "zcode-plugins-official",
  9. pluginCount: 0,
  10. source: "https://cdn-zcode.z.ai/zcode/official-plugin/marketplace.json",
  11. }),
  12. expect.objectContaining({
  13. id: "claude-plugins-official",
  14. name: "claude-plugins-official",
  15. pluginCount: 0,
  16. source: "anthropics/claude-plugins-official",
  17. }),
  18. ]);
  19. });
  20. it("classifies only the ZCode-operated channels as public store marketplaces", () => {
  21. expect(isPublicStoreMarketplaceId("zcode-plugins-official")).toBe(true);
  22. expect(isPublicStoreMarketplaceId("zcode-plugins")).toBe(false);
  23. // Claude 官方市场受信但不属于「公开」分段(归个人),见 CONTEXT.md 术语表。
  24. expect(isPublicStoreMarketplaceId("claude-plugins-official")).toBe(false);
  25. expect(isPublicStoreMarketplaceId("inline")).toBe(false);
  26. });
  27. });