-
Notifications
You must be signed in to change notification settings - Fork 10
/
jest.config.js
60 lines (59 loc) · 1.27 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
const { defaults: tsjPreset } = require('ts-jest/presets');
module.exports = {
cacheDirectory: '.jest/cache',
collectCoverageFrom: [
'<rootDir>/src/**/**/*.+(ts|tsx|js)',
'!<rootDir>/src/**/**/*.test.+(ts|tsx|js)',
'!<rootDir>/src/**/**/*.device.+(ts|tsx|js)',
'!<rootDir>/src/**/**/*.stories.+(ts|tsx|js)',
'!<rootDir>/src/**/**/*.data.+(ts|tsx|js)',
],
coverageThreshold: {
global: {
branches: 55,
functions: 70,
lines: 75,
statements: 75,
},
},
preset: 'react-native',
moduleDirectories: [
'node_modules',
'test',
],
moduleFileExtensions: [
'ts',
'tsx',
'js',
'jsx',
'json',
'node',
],
moduleNameMapper: {
'/\.svg/': '<rootDir>/__mocks__/svgMock.js',
},
setupFilesAfterEnv: [
'<rootDir>/test/testSetup.ts',
],
testMatch: [
'**/__tests__/**/*.+(ts|tsx|js)',
'**/?(*.)+(spec|test).+(ts|tsx|js)',
],
testPathIgnorePatterns: [
'<rootDir>/dist/',
'<rootDir>/build/',
'<rootDir>/lib/',
'<rootDir>/storybook/',
],
...tsjPreset,
globals: {
'ts-jest': {
babelConfig: true,
diagnostics: false,
},
},
transform: {
...tsjPreset.transform,
'\\.js$': '<rootDir>/node_modules/react-native/jest/preprocessor.js',
},
};