test: tighten Claude bundle inspect assertions

This commit is contained in:
Shakker
2026-05-11 06:41:15 +01:00
parent 3218f37c7f
commit 0d92a76232

View File

@@ -101,11 +101,11 @@ describe("Claude bundle plugin inspect integration", () => {
function expectClaudeManifestField(params: {
field: "skills" | "hooks" | "settingsFiles" | "capabilities";
includes: readonly string[];
expected: readonly string[];
}) {
const manifest = expectLoadedClaudeManifest();
const values = manifest[params.field];
expect(values).toEqual(expect.arrayContaining([...params.includes]));
expect(values).toEqual([...params.expected]);
}
function expectNoDiagnostics(diagnostics: unknown[]) {
@@ -123,9 +123,7 @@ describe("Claude bundle plugin inspect integration", () => {
hasSupportedKey: "hasSupportedStdioServer" | "hasStdioServer";
}) {
expect(params.actual[params.hasSupportedKey]).toBe(true);
expect(params.actual.supportedServerNames).toEqual(
expect.arrayContaining([...params.supportedServerNames]),
);
expect(params.actual.supportedServerNames).toEqual([...params.supportedServerNames]);
expect(params.actual.unsupportedServerNames).toEqual([...params.unsupportedServerNames]);
expectNoDiagnostics(params.actual.diagnostics);
}
@@ -162,11 +160,25 @@ describe("Claude bundle plugin inspect integration", () => {
it("loads the full Claude bundle manifest with all capabilities", () => {
const m = expectLoadedClaudeManifest();
expect(m).toMatchObject({
expect(m).toEqual({
id: "test-claude-plugin",
name: "Test Claude Plugin",
description: "Integration test fixture for Claude bundle inspection",
version: "1.0.0",
skills: ["skill-packs", "extra-commands", "agents", "output-styles"],
settingsFiles: ["settings.json"],
hooks: ["hooks/hooks.json", "custom-hooks"],
bundleFormat: "claude",
capabilities: [
"skills",
"commands",
"agents",
"hooks",
"mcpServers",
"lspServers",
"outputStyles",
"settings",
],
});
});
@@ -174,22 +186,22 @@ describe("Claude bundle plugin inspect integration", () => {
{
name: "resolves skills from skills, commands, and agents paths",
field: "skills" as const,
includes: ["skill-packs", "extra-commands", "agents", "output-styles"],
expected: ["skill-packs", "extra-commands", "agents", "output-styles"],
},
{
name: "resolves hooks from default and declared paths",
field: "hooks" as const,
includes: ["hooks/hooks.json", "custom-hooks"],
expected: ["hooks/hooks.json", "custom-hooks"],
},
{
name: "detects settings files",
field: "settingsFiles" as const,
includes: ["settings.json"],
expected: ["settings.json"],
},
{
name: "detects all bundle capabilities",
field: "capabilities" as const,
includes: [
expected: [
"skills",
"commands",
"agents",
@@ -200,8 +212,8 @@ describe("Claude bundle plugin inspect integration", () => {
"settings",
],
},
] as const)("$name", ({ field, includes }) => {
expectClaudeManifestField({ field, includes });
] as const)("$name", ({ field, expected }) => {
expectClaudeManifestField({ field, expected });
});
it.each([