-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjest.config.js
27 lines (25 loc) · 950 Bytes
/
jest.config.js
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
const { defaults } = require('jest-config');
const customJestConfig = {
...defaults,
preset: 'ts-jest',
collectCoverage: true,
coverageDirectory: 'js-coverage',
coverageReporters: ['lcov', 'text'],
testPathIgnorePatterns: ['/cypress/', '__tests__/mockdata/'],
moduleNameMapper: {
'^.+\\.(svg)$': '<rootDir>/__mocks__/fileMock.js',
'\\.(css|less|scss|sss|styl)$': '<rootDir>/__mocks__/styleMock.js',
},
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
testEnvironment: 'jest-environment-jsdom',
transform: {
'^.+\\.tsx?$': [
'ts-jest',
// required due to custom location of tsconfig.json configuration file
// https://kulshekhar.github.io/ts-jest/docs/getting-started/options/tsconfig
{ tsconfig: 'tsconfig.test.json' },
],
'\\.svg$': './jest/transformers/raw-loader.js',
},
};
module.exports = customJestConfig;