import { describe, it, expect } from "vitest";
import {
generateCursorRulesHandler,
generateGeminiConfigHandler,
generateClaudeConfigHandler,
generateWindsurfConfigHandler,
generateAiderConfigHandler,
generateClineConfigHandler,
generateCopilotConfigHandler,
} from "./aiconfigs.js";
describe("AI Config Tools", () => {
describe("generateCursorRulesHandler", () => {
it("should generate cursor rules", () => {
const result = generateCursorRulesHandler({
projectName: "TestProject",
languages: ["typescript"],
frameworks: ["react"],
databases: ["postgresql"],
});
expect(result.content[0].text).toContain("# TestProject - Cursor Rules");
expect(result.content[0].text).toContain(
"typescript project using react",
); // Single language, no slash
expect(result.content[0].text).toContain("postgresql");
});
});
describe("generateGeminiConfigHandler", () => {
it("should generate gemini config", () => {
const result = generateGeminiConfigHandler({
projectName: "TestProject",
languages: ["python"],
description: "A test project",
});
expect(result.content[0].text).toContain("# TestProject");
expect(result.content[0].text).toContain("A test project");
});
});
describe("generateClaudeConfigHandler", () => {
it("should generate claude config", () => {
const result = generateClaudeConfigHandler({
projectName: "TestProject",
languages: ["javascript"],
});
expect(result.content[0].text).toContain("# TestProject");
expect(result.content[0].text).toContain(
"javascript idioms and best practices",
);
});
});
describe("generateWindsurfConfigHandler", () => {
it("should generate windsurf config", () => {
const result = generateWindsurfConfigHandler({
projectName: "TestProject",
languages: ["go"],
});
expect(result.content[0].text).toContain("Windsurf Rules");
expect(result.content[0].text).toContain("go");
});
});
describe("generateAiderConfigHandler", () => {
it("should generate aider config", () => {
const result = generateAiderConfigHandler({
projectName: "TestProject",
languages: ["python"],
model: "gpt-3.5-turbo",
});
expect(result.content[0].text).toContain("gpt-3.5-turbo");
expect(result.content[0].text).toContain("auto-commits: true");
});
});
describe("generateClineConfigHandler", () => {
it("should generate cline config", () => {
const result = generateClineConfigHandler({
projectName: "TestProject",
languages: ["rust"],
});
expect(result.content[0].text).toContain("Cline Rules");
expect(result.content[0].text).toContain("rust");
});
});
describe("generateCopilotConfigHandler", () => {
it("should generate copilot config", () => {
const result = generateCopilotConfigHandler({
projectName: "TestProject",
languages: ["java"],
frameworks: ["spring"],
});
expect(result.content[0].text).toContain("GitHub Copilot Instructions");
expect(result.content[0].text).toContain("java");
expect(result.content[0].text).toContain("spring");
});
});
});