feat: configure Jest testing infrastructure
- 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
This commit is contained in:
@@ -17,10 +17,16 @@
|
||||
],
|
||||
"coverageDirectory": "coverage",
|
||||
"coverageReporters": ["text", "lcov", "html"],
|
||||
"moduleNameMapping": {
|
||||
"^@/(.*)$": "<rootDir>/$1"
|
||||
"moduleNameMapper": {
|
||||
"^@/(.*)$": "<rootDir>/$1",
|
||||
"^uuid$": "<rootDir>/tests/__mocks__/uuid.js",
|
||||
"^node-fetch$": "<rootDir>/tests/__mocks__/node-fetch.js"
|
||||
},
|
||||
"transform": {
|
||||
"^.+\\.tsx?$": "ts-jest"
|
||||
}
|
||||
"^.+\\.tsx?$": "ts-jest",
|
||||
"^.+\\.jsx?$": "babel-jest"
|
||||
},
|
||||
"transformIgnorePatterns": ["node_modules/(?!(@jest/transform|uuid|node-fetch)/)"],
|
||||
"testTimeout": 30000,
|
||||
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user