contract.test.ts 552 B

1234567891011
  1. import { expect, it } from "vitest";
  2. import { parsePluginManifest, pluginManifestName } from "../../src/plugins/discovery/index.js";
  3. it("rejects invalid plugin identities at the shared discovery boundary", () => {
  4. expect(() => parsePluginManifest({ name: "../outside" })).toThrow("Invalid plugin name");
  5. expect(pluginManifestName({ name: "../outside" })).toBeUndefined();
  6. expect(parsePluginManifest({ name: "example", mcpServers: "./mcp.json" })).toMatchObject({
  7. name: "example",
  8. mcpServers: "./mcp.json",
  9. version: "0.0.0",
  10. });
  11. });