- Add Jest testing framework configuration - Add test files for services, types, and utilities - Update package.json with Jest dependencies and test scripts - Enhance pre-commit checks to include testing - Add proper environment validation and error handling in mailgun service
36 lines
1.0 KiB
JSON
36 lines
1.0 KiB
JSON
{
|
|
"preset": "ts-jest",
|
|
"testEnvironment": "jsdom",
|
|
"setupFilesAfterEnv": ["<rootDir>/tests/setup.ts"],
|
|
"testMatch": [
|
|
"<rootDir>/services/**/__tests__/**/*.test.ts",
|
|
"<rootDir>/utils/**/__tests__/**/*.test.ts",
|
|
"<rootDir>/types/**/__tests__/**/*.test.ts",
|
|
"<rootDir>/tests/**/*.test.ts",
|
|
"<rootDir>/tests/**/*.test.js"
|
|
],
|
|
"collectCoverageFrom": [
|
|
"services/**/*.ts",
|
|
"components/**/*.tsx",
|
|
"hooks/**/*.ts",
|
|
"utils/**/*.ts",
|
|
"types/**/*.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"]
|
|
}
|