import { describe, it, expect } from "vitest";
import { generateDocumentationHandler } from "./documentation.js";
describe("Documentation Tools", () => {
describe("generate_documentation", () => {
it("should generate all documentation types by default", () => {
const result = generateDocumentationHandler({
projectPath: "./",
outputDir: "docs",
});
const text = result.content[0].text;
const files = result.content[0].artifacts;
expect(text).toContain("Generated 3 documentation files");
expect(files).toHaveLength(3);
expect(files[0].name).toContain("architecture.md");
});
it("should extract architecture documentation", () => {
const result = generateDocumentationHandler({
projectPath: "./",
focus: "architecture",
});
const file = result.content[0].artifacts[0];
expect(file.content).toContain("# System Architecture");
expect(file.content).toContain("Overview");
});
it("should extract api documentation", () => {
const result = generateDocumentationHandler({
projectPath: "./",
focus: "api",
});
const file = result.content[0].artifacts[0];
expect(file.content).toContain("# API Reference");
expect(file.content).toContain("Tools");
});
});
});