55 lines
1.4 KiB
TypeScript
55 lines
1.4 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import type { HookStatusReport } from "../hooks/hooks-status.js";
|
|
import { formatHooksCheck, formatHooksList } from "./hooks-cli.js";
|
|
|
|
const report: HookStatusReport = {
|
|
workspaceDir: "/tmp/workspace",
|
|
managedHooksDir: "/tmp/hooks",
|
|
hooks: [
|
|
{
|
|
name: "session-memory",
|
|
description: "Save session context to memory",
|
|
source: "clawdbot-bundled",
|
|
filePath: "/tmp/hooks/session-memory/HOOK.md",
|
|
baseDir: "/tmp/hooks/session-memory",
|
|
handlerPath: "/tmp/hooks/session-memory/handler.js",
|
|
hookKey: "session-memory",
|
|
emoji: "💾",
|
|
homepage: "https://docs.clawd.bot/hooks#session-memory",
|
|
events: ["command:new"],
|
|
always: false,
|
|
disabled: false,
|
|
eligible: true,
|
|
requirements: {
|
|
bins: [],
|
|
anyBins: [],
|
|
env: [],
|
|
config: [],
|
|
os: [],
|
|
},
|
|
missing: {
|
|
bins: [],
|
|
anyBins: [],
|
|
env: [],
|
|
config: [],
|
|
os: [],
|
|
},
|
|
configChecks: [],
|
|
install: [],
|
|
},
|
|
],
|
|
};
|
|
|
|
describe("hooks cli formatting", () => {
|
|
it("labels hooks list output", () => {
|
|
const output = formatHooksList(report, {});
|
|
expect(output).toContain("Hooks");
|
|
expect(output).not.toContain("Internal Hooks");
|
|
});
|
|
|
|
it("labels hooks status output", () => {
|
|
const output = formatHooksCheck(report, {});
|
|
expect(output).toContain("Hooks Status");
|
|
});
|
|
});
|