build: enhance test configuration and TypeScript handling

- Update Jest config to use ts-jest for better TypeScript support
- Add TSX test file pattern support for React components
- Improve Babel config with proper TypeScript preset settings
- Enable better import.meta transformation for Jest compatibility
This commit is contained in:
William Valentin
2025-10-16 13:16:37 -07:00
parent bf36f14eab
commit f44ec57c62
2 changed files with 35 additions and 15 deletions

View File

@@ -7,6 +7,7 @@
"<rootDir>/types/**/__tests__/**/*.test.ts",
"<rootDir>/components/**/__tests__/**/*.test.tsx",
"<rootDir>/tests/**/*.test.ts",
"<rootDir>/tests/**/*.test.tsx",
"<rootDir>/tests/**/*.test.js"
],
"collectCoverageFrom": [
@@ -25,7 +26,14 @@
"^node-fetch$": "<rootDir>/tests/__mocks__/node-fetch.js"
},
"transform": {
"^.+\\.tsx?$": "babel-jest",
"^.+\\.tsx?$": [
"ts-jest",
{
"tsconfig": "tsconfig.json",
"babelConfig": "babel.config.cjs",
"diagnostics": false
}
],
"^.+\\.jsx?$": "babel-jest"
},
"transformIgnorePatterns": ["node_modules/(?!(@jest/transform|uuid|node-fetch)/)"],