- Update Jest config with module name mapping for uuid and node-fetch - Add Babel transform for mixed JS/TS support - Configure transformIgnorePatterns for ES modules - Add comprehensive test mocks for uuid and node-fetch - Setup import.meta environment variables for Jest compatibility - Increase test timeout to 30 seconds for integration tests
33 lines
943 B
JSON
33 lines
943 B
JSON
{
|
|
"preset": "ts-jest",
|
|
"testEnvironment": "jsdom",
|
|
"setupFilesAfterEnv": ["<rootDir>/tests/setup.ts"],
|
|
"testMatch": [
|
|
"<rootDir>/services/**/__tests__/**/*.test.ts",
|
|
"<rootDir>/tests/**/*.test.ts",
|
|
"<rootDir>/tests/**/*.test.js"
|
|
],
|
|
"collectCoverageFrom": [
|
|
"services/**/*.ts",
|
|
"components/**/*.tsx",
|
|
"hooks/**/*.ts",
|
|
"utils/**/*.ts",
|
|
"!**/*.d.ts",
|
|
"!**/__tests__/**"
|
|
],
|
|
"coverageDirectory": "coverage",
|
|
"coverageReporters": ["text", "lcov", "html"],
|
|
"moduleNameMapper": {
|
|
"^@/(.*)$": "<rootDir>/$1",
|
|
"^uuid$": "<rootDir>/tests/__mocks__/uuid.js",
|
|
"^node-fetch$": "<rootDir>/tests/__mocks__/node-fetch.js"
|
|
},
|
|
"transform": {
|
|
"^.+\\.tsx?$": "ts-jest",
|
|
"^.+\\.jsx?$": "babel-jest"
|
|
},
|
|
"transformIgnorePatterns": ["node_modules/(?!(@jest/transform|uuid|node-fetch)/)"],
|
|
"testTimeout": 30000,
|
|
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"]
|
|
}
|