generated from kubefirst/react-app-template
-
Notifications
You must be signed in to change notification settings - Fork 8
/
jest.config.ts
36 lines (34 loc) · 990 Bytes
/
jest.config.ts
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
29
30
31
32
33
34
35
36
import type { Config } from '@jest/types';
const config: Config.InitialOptions = {
verbose: true,
preset: 'ts-jest',
moduleFileExtensions: ['js', 'json', 'tsx', 'ts'],
setupFilesAfterEnv: ['<rootDir>/tests/jest.setup.ts'],
transformIgnorePatterns: ['<rootDir>/node_modules/'],
coveragePathIgnorePatterns: [
'/node_modules/',
'/tests/',
'/assets/',
'./jest.config.ts',
'./storybook',
],
collectCoverageFrom: ['**/*.{ts,tsx}', '!**/*.d.{ts,tsx}', '!**/*.stories.{ts,tsx}'],
transform: {
'^.+\\.js$': 'babel-jest',
'^.+\\.(ts|tsx)?$': 'ts-jest',
'^.+\\.(jpg|jpeg|png|gif|svg|css|webp)$': '<rootDir>/tests/file-mock.ts',
},
moduleNameMapper: {
'tests/(.*)': '<rootDir>/tests/$1',
'uuid': require.resolve('uuid'),
'^@/(.*)$': '<rootDir>//$1',
},
testEnvironment: 'jsdom',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tests/tsconfig.test.json',
isolatedModules: true,
},
},
};
export default config;