-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.ts
29 lines (27 loc) · 1.04 KB
/
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
import { pathsToModuleNameMapper, JestConfigWithTsJest } from 'ts-jest';
import { compilerOptions } from './tsconfig.json';
const config: JestConfigWithTsJest = {
clearMocks: true,
collectCoverageFrom: [
'<rootDir>/src/pages/**/*.[jt]s?(x)',
'!<rootDir>/src/pages/**/*.{spec,test}.[jt]s?(x)',
'!<rootDir>/src/pages/index.[jt]s',
'!<rootDir>/src/pages/**/components/index.[jt]s',
'<rootDir>/src/shared/components/**/*.[jt]s?(x)',
'!<rootDir>/src/shared/components/**/*.{spec,test}.[jt]s?(x)',
'!<rootDir>/src/shared/components/index.[jt]s',
'!<rootDir>/src/shared/hooks/*.[jt]s',
],
preset: 'ts-jest',
collectCoverage: true,
coverageDirectory: 'coverage',
coverageReporters: ['lcov', 'json', 'text', 'text-summary'],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>/',
}),
roots: ['<rootDir>/src'],
setupFilesAfterEnv: ['<rootDir>/src/application/test/setup.ts'],
testEnvironment: 'jsdom',
testPathIgnorePatterns: ['/node_modules/'],
};
export default config;