Files
mcp-tool/jest.config.js
nasir@endelospay.com 8c74b0e23f first
2025-07-11 20:22:12 +05:00

107 lines
2.0 KiB
JavaScript

/**
* @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,
// Transform configuration for ES modules
transform: {},
// 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: ["<rootDir>/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: "<rootDir>/.jest-cache",
// Ignore patterns
testPathIgnorePatterns: ["/node_modules/", "/logs/", "/docs/"],
// Watch ignore patterns
watchPathIgnorePatterns: [
"/node_modules/",
"/logs/",
"/docs/",
"/.jest-cache/",
],
};