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:
William Valentin
2025-09-07 15:20:59 -07:00
parent 315303b120
commit c5d3631cb6
5 changed files with 185 additions and 5 deletions

View File

@@ -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"]
}