Files
Nikhil-Doye 5ff245f7d8 Add Jest configuration and testing utilities for improved test coverage
- Introduced a Jest configuration file to set up the testing environment with jsdom and TypeScript support.
- Added setupTests.ts to mock localStorage and console methods, enhancing test reliability and reducing noise.
- Implemented comprehensive test cases for llmProcessor and copilotService, ensuring robust functionality and error handling.
- Created unit tests for variable substitution utility, validating correct behavior for various scenarios.
- Enhanced database connection manager tests to cover connection handling and credential validation.
- Established a workflow store test suite to validate workflow management and node/edge operations.
2025-10-20 15:36:35 -04:00

35 lines
865 B
JavaScript

module.exports = {
testEnvironment: "jsdom",
setupFilesAfterEnv: ["<rootDir>/src/setupTests.ts"],
moduleNameMapping: {
"^@/(.*)$": "<rootDir>/src/$1",
},
collectCoverageFrom: [
"src/**/*.{ts,tsx}",
"!src/**/*.d.ts",
"!src/index.tsx",
"!src/setupTests.ts",
"!src/test-*.ts", // Exclude manual test files
],
coverageThreshold: {
global: {
branches: 70,
functions: 70,
lines: 70,
statements: 70,
},
},
testMatch: [
"<rootDir>/src/**/__tests__/**/*.{ts,tsx}",
"<rootDir>/src/**/*.{test,spec}.{ts,tsx}",
],
transform: {
"^.+\\.(ts|tsx)$": "ts-jest",
},
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json"],
testPathIgnorePatterns: ["/node_modules/", "/build/"],
collectCoverage: true,
coverageDirectory: "coverage",
coverageReporters: ["text", "lcov", "html"],
};