-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.ts
28 lines (26 loc) · 957 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
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/**/*.styled.[jt]s',
'<rootDir>/src/shared/components/**/*.[jt]s?(x)',
'!<rootDir>/src/shared/components/**/*.styled.[jt]s',
],
collectCoverage: true,
coverageDirectory: 'coverage',
coverageReporters: ['lcov', 'json', 'text', 'text-summary'],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, {
prefix: '<rootDir>/',
}),
preset: 'ts-jest',
roots: ['<rootDir>/src'],
setupFilesAfterEnv: ['<rootDir>/src/application/test/setupTests.ts'],
testEnvironment: 'jsdom',
testPathIgnorePatterns: ['/node_modules/'],
transform: {
'\\.(jpg|jpeg|png)$': '<rootDir>/src/application/test/transform/index.js',
},
};
export default config;