Code Review MCP Server

by crazyrabbitLTC
Verified
/** * @file Repomix Integration Tests * @version 0.1.0 * @status STABLE - COMPLETE TEST COVERAGE * @lastModified 2024-03-24 * * Tests for the Repomix integration functionality * * Test Coverage: * - Function exports * - Options interface */ import { describe, it, expect, beforeAll, afterAll } from "bun:test"; import * as fs from "fs"; import * as path from "path"; import { executeRepomix, RepomixOptions } from "../../src/repomix.js"; describe("Repomix", () => { const testDir = path.join(process.cwd(), "test", "testRepo"); beforeAll(() => { if (!fs.existsSync(testDir)) { fs.mkdirSync(testDir, { recursive: true }); } fs.writeFileSync( path.join(testDir, "test.js"), "function add(a, b) { return a + b; }" ); fs.writeFileSync( path.join(testDir, "test.ts"), "function subtract(a: number, b: number): number { return a - b; }" ); }); afterAll(() => { if (fs.existsSync(testDir)) { fs.rmSync(testDir, { recursive: true, force: true }); } }); it("should export functions", () => { expect(typeof executeRepomix).toBe("function"); }); it("should accept options", () => { const options = { includePaths: ["src/**/*.ts"], excludePaths: ["node_modules"], fileTypes: [".ts", ".js"] }; expect(options.includePaths).toContain("src/**/*.ts"); expect(options.excludePaths).toContain("node_modules"); expect(options.fileTypes).toEqual([".ts", ".js"]); }); });