/** * @fileoverview Jest configuration for Laravel Healthcare MCP Server tests * Configures testing environment for comprehensive MCP tool testing */ export default { // Test environment testEnvironment: "node", // Module type preset: null, // Enable ES modules support extensionsToTreatAsEsm: [], // Transform configuration for ES modules transform: {}, // Module name mapping for ES modules moduleNameMapper: { "^(\\.{1,2}/.*)\\.js$": "$1", }, // Test file patterns testMatch: ["**/tests/**/*.test.js", "**/tests/**/*.spec.js"], // Coverage configuration collectCoverage: false, collectCoverageFrom: [ "src/**/*.js", "!src/**/*.test.js", "!src/**/*.spec.js", "!**/node_modules/**", ], // Coverage thresholds coverageThreshold: { global: { branches: 80, functions: 80, lines: 80, statements: 80, }, }, // Coverage reporters coverageReporters: [ "text", "text-summary", "html", "lcov", "json", "json-summary", ], // Setup files setupFilesAfterEnv: ["/tests/setup.js"], // Test timeout testTimeout: 30000, // Verbose output verbose: true, // Clear mocks between tests clearMocks: true, // Restore mocks after each test restoreMocks: true, // Error handling errorOnDeprecated: true, // Module directories moduleDirectories: ["node_modules", "src"], // Global variables globals: { "process.env.NODE_ENV": "test", testConstants: { AUTH_TYPES: { PUBLIC: "public", PROVIDER: "provider", PATIENT: "patient", PARTNER: "partner", AFFILIATE: "affiliate", NETWORK: "network", }, API_BASE_URL: "https://test-api.healthcare.com", TIMEOUT: 5000, RETRY_ATTEMPTS: 2, }, }, // Test results processor testResultsProcessor: undefined, // Max workers for parallel testing maxWorkers: "50%", // Cache directory cacheDirectory: "/.jest-cache", // Ignore patterns testPathIgnorePatterns: ["/node_modules/", "/logs/", "/docs/"], // Watch ignore patterns watchPathIgnorePatterns: [ "/node_modules/", "/logs/", "/docs/", "/.jest-cache/", ], };