Tests: update Claude bundle integration test for agents, output styles, and LSP

This commit is contained in:
Vincent Koc 2026-03-18 00:11:59 -07:00
parent 4ebd3d11aa
commit 6538c87673

View File

@ -2,6 +2,7 @@ import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { afterAll, beforeAll, describe, expect, it } from "vitest";
import { inspectBundleLspRuntimeSupport } from "./bundle-lsp.js";
import { loadBundleManifest } from "./bundle-manifest.js";
import { inspectBundleMcpRuntimeSupport } from "./bundle-mcp.js";
@ -89,8 +90,19 @@ describe("Claude bundle plugin inspect integration", () => {
// agents/ directory
fs.mkdirSync(path.join(rootDir, "agents"), { recursive: true });
// .lsp.json
fs.writeFileSync(path.join(rootDir, ".lsp.json"), '{"lspServers":{}}', "utf-8");
// .lsp.json with a stdio LSP server
fs.writeFileSync(
path.join(rootDir, ".lsp.json"),
JSON.stringify({
lspServers: {
"typescript-lsp": {
command: "typescript-language-server",
args: ["--stdio"],
},
},
}),
"utf-8",
);
// output-styles/ directory
fs.mkdirSync(path.join(rootDir, "output-styles"), { recursive: true });
@ -114,7 +126,7 @@ describe("Claude bundle plugin inspect integration", () => {
expect(m.bundleFormat).toBe("claude");
});
it("resolves skills from both skills and commands paths", () => {
it("resolves skills from skills, commands, and agents paths", () => {
const result = loadBundleManifest({ rootDir, bundleFormat: "claude" });
expect(result.ok).toBe(true);
if (!result.ok) {
@ -123,6 +135,9 @@ describe("Claude bundle plugin inspect integration", () => {
expect(result.manifest.skills).toContain("skill-packs");
expect(result.manifest.skills).toContain("extra-commands");
// Agent and output style dirs are merged into skills so their .md files are discoverable
expect(result.manifest.skills).toContain("agents");
expect(result.manifest.skills).toContain("output-styles");
});
it("resolves hooks from default and declared paths", () => {
@ -177,4 +192,17 @@ describe("Claude bundle plugin inspect integration", () => {
expect(mcp.unsupportedServerNames).toContain("test-sse-server");
expect(mcp.diagnostics).toEqual([]);
});
it("inspects LSP runtime support with stdio server", () => {
const lsp = inspectBundleLspRuntimeSupport({
pluginId: "test-claude-plugin",
rootDir,
bundleFormat: "claude",
});
expect(lsp.hasStdioServer).toBe(true);
expect(lsp.supportedServerNames).toContain("typescript-lsp");
expect(lsp.unsupportedServerNames).toEqual([]);
expect(lsp.diagnostics).toEqual([]);
});
});