-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathjest.config.js
46 lines (45 loc) · 1.29 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
process.env.NODE_ICU_DATA = 'node_modules/full-icu';
process.env.TZ = 'UTC'; // will not work on Windows https://github.com/nodejs/node/issues/4230
module.exports = {
preset: 'ts-jest/presets/js-with-ts',
testEnvironment: 'jsdom',
testMatch: [
'<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/**/?(*.)(spec|test).{js,jsx,ts,tsx}',
],
setupFiles: ['jest-date-mock'],
moduleNameMapper: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/src/utils/assetsTransformer.js',
'\\.(css|less)$': '<rootDir/src/utils/assetsTransformer.js',
},
coveragePathIgnorePatterns: [
'node_modules',
'dist',
'.module.ts',
'<rootDir>/src/index.ts',
'.*\\.d\\.ts',
'.test.{ts,tsx}',
'.mock.{ts,tsx}',
'__tests__',
'interfaces.ts',
],
testPathIgnorePatterns: ['mocks.ts'],
modulePathIgnorePatterns: ['<rootDir>/dist'],
collectCoverage: true,
coverageReporters: ['html', 'lcov'],
collectCoverageFrom: [
'<rootDir>/src/**/*.{js,ts,tsx,jsx}',
'!<rootDir>/src/**/*.stories.*',
'!src/**/style.ts',
],
setupFilesAfterEnv: ['<rootDir>/jest-setup.ts'],
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 90,
statements: 80,
},
},
};