-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.js
45 lines (43 loc) · 1.22 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
import { pathsToModuleNameMapper } from 'ts-jest';
import tsconfig from './tsconfig.json' assert { type: 'json' };
export default {
bail: false,
preset: 'ts-jest/presets/js-with-ts',
rootDir: '.',
testRegex: '(/__tests__/*.test.js|\\.(test))\\.(jsx|js|tsx|ts)$',
moduleFileExtensions: ['jsx', 'js', 'tsx', 'ts', 'json'],
collectCoverage: false,
coverageThreshold: {
global: {
branches: 80,
functions: 80,
lines: 80,
statements: 80,
},
},
collectCoverageFrom: [
'src/**/*.{js,jsx,ts,tsx}',
'!src/index.js',
'!src/index.ts',
'!src/lib.ts',
],
moduleDirectories: ['node_modules', '<rootDir>'],
moduleNameMapper: {
...pathsToModuleNameMapper(tsconfig.compilerOptions.paths, {
prefix: '<rootDir>',
}),
'.+\\.(css|less|sass|scss)$': 'identity-obj-proxy',
'\\.(svg|png)$': '<rootDir>/test/__mocks__/empty-module.ts',
},
testEnvironment: 'jsdom',
testEnvironmentOptions: {
customExportConditions: [''],
},
transform: {
'^.+\\.jsx?$': 'ts-jest',
'^.+\\.tsx?$': 'ts-jest',
},
transformIgnorePatterns: ['node_modules/(?!pretty-bytes/.*)'],
setupFilesAfterEnv: ['<rootDir>/test/setup.ts'],
globalSetup: './test/global-setup.ts',
};