-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.config.js
More file actions
28 lines (27 loc) · 861 Bytes
/
Copy pathjest.config.js
File metadata and controls
28 lines (27 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
* Jest configuration for the project
*
* This configures Jest to:
* - Use ts-jest preset for TypeScript support
* - Run tests in jsdom environment for DOM testing
* - Handle TypeScript and JavaScript file extensions
* - Transform TypeScript files using ts-jest
* - Match test files using standard naming patterns
* - Map module imports starting with @ to the root directory
* - Load setup file for additional test configuration
*/
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
transform: {
'^.+\\.(ts|tsx)$': ['ts-jest', {
tsconfig: 'tsconfig.json',
}],
},
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/$1',
},
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
};