mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-03 08:01:15 +00:00
test: tighten Claude bundle inspect assertions
This commit is contained in:
@@ -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([
|
||||
|
||||
Reference in New Issue
Block a user