mirror of
https://github.com/Nikhil-Doye/workflow-builder.git
synced 2026-07-22 02:01:56 +02:00
5ff245f7d8
- 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.
35 lines
865 B
JavaScript
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"],
|
|
};
|