/** * Integration tests for Testing Best Practices MCP Server */ import { describe, it, expect, beforeEach } from "vitest"; import { XrayTestingBestPracticesServer } from "./testing-best-practices.server"; import * as fs from "fs"; import * as path from "path"; describe("testing-best-practices.server integration", () => { describe("module exports", () => { it("should export server class", () => { expect(XrayTestingBestPracticesServer).toBeDefined(); expect(typeof XrayTestingBestPracticesServer).toBe("function"); }); it("should be able to instantiate the server", () => { const server = new XrayTestingBestPracticesServer(); expect(server).toBeDefined(); }); it("should have run method", () => { const server = new XrayTestingBestPracticesServer(); expect(typeof server.run).toBe("function"); }); }); describe("server structure", () => { let server: XrayTestingBestPracticesServer; beforeEach(() => { server = new XrayTestingBestPracticesServer(); }); it("should instantiate correctly", () => { expect(server).toBeInstanceOf(XrayTestingBestPracticesServer); }); it("should have run async method", () => { expect(server.run).toBeInstanceOf(Function); }); }); describe("test analysis capabilities", () => { let server: XrayTestingBestPracticesServer; beforeEach(() => { server = new XrayTestingBestPracticesServer(); }); it("should analyze test coverage", () => { expect(server).toBeInstanceOf(XrayTestingBestPracticesServer); }); it("should identify test gaps", () => { expect(server).toBeInstanceOf(XrayTestingBestPracticesServer); }); it("should provide recommendations", () => { expect(server).toBeInstanceOf(XrayTestingBestPracticesServer); }); }); describe("test strategy types", () => { let server: XrayTestingBestPracticesServer; beforeEach(() => { server = new XrayTestingBestPracticesServer(); }); it("should support unit tests", () => { expect(server).toBeInstanceOf(XrayTestingBestPracticesServer); }); it("should support integration tests", () => { expect(server).toBeInstanceOf(XrayTestingBestPracticesServer); }); it("should support e2e tests", () => { expect(server).toBeInstanceOf(XrayTestingBestPracticesServer); }); it("should support performance tests", () => { expect(server).toBeInstanceOf(XrayTestingBestPracticesServer); }); it("should support security tests", () => { expect(server).toBeInstanceOf(XrayTestingBestPracticesServer); }); }); describe("TDD/BDD implementation", () => { let server: XrayTestingBestPracticesServer; beforeEach(() => { server = new XrayTestingBestPracticesServer(); }); it("should provide TDD guidance", () => { expect(server).toBeInstanceOf(XrayTestingBestPracticesServer); }); it("should provide BDD guidance", () => { expect(server).toBeInstanceOf(XrayTestingBestPracticesServer); }); it("should suggest test frameworks", () => { expect(server).toBeInstanceOf(XrayTestingBestPracticesServer); }); }); describe("automation workflows", () => { let server: XrayTestingBestPracticesServer; beforeEach(() => { server = new XrayTestingBestPracticesServer(); }); it("should calculate automation potential", () => { expect(server).toBeInstanceOf(XrayTestingBestPracticesServer); }); it("should analyze test frameworks", () => { const projectRoot = process.cwd(); const exists = fs.existsSync(projectRoot); expect(exists).toBe(true); }); it("should work with vitest", () => { const projectRoot = process.cwd(); const packageJsonPath = path.join(projectRoot, "package.json"); const hasPackageJson = fs.existsSync(packageJsonPath); expect(hasPackageJson).toBe(true); }); }); });