import { describe, it, expect } from "vitest";
import { summarizeFilesHandler, aggregateContextHandler } from "./context.js";
describe("Context Tools", () => {
describe("summarizeFilesHandler", () => {
it("should generate summary prompt", () => {
const result = summarizeFilesHandler({
files: ["/path/to/a", "/path/to/b"],
detailLevel: "brief",
});
expect(result.content[0].text).toContain(
"Please summarize the following 2 files",
);
expect(result.content[0].text).toContain("- /path/to/a");
});
});
describe("aggregateContextHandler", () => {
it("should generate aggregate context placeholder", () => {
const result = aggregateContextHandler({
task: "Fix bug",
});
expect(result.content[0].text).toContain(
'# Aggregated Context for: "Fix bug"',
);
expect(result.content[0].text).toContain("System would auto-gather");
});
});
});