@@ -25,50 +25,32 @@ module.exports = {
25
25
verbose : true ,
26
26
cacheDirectory : '<rootDir>/tmp/jest' ,
27
27
moduleFileExtensions : [ 'ts' , 'tsx' , 'js' , 'json' ] ,
28
- // preset configs
29
- // preset: 'ts-jest/presets/js-with-ts',
30
- // which files to test and which to ignore
31
28
testMatch : [ '**/src/tests/*.test.(ts|tsx)' ] ,
32
29
testPathIgnorePatterns : [ '/node_modules/' , '/tmp/' , '/coverage/' , '/stories/' , '/\\.storybook/' ] ,
33
- // don't watch for file changes in node_modules
34
30
watchPathIgnorePatterns : [ '/node_modules/' ] ,
35
- // jest automock settings
36
31
automock : false ,
37
32
unmockedModulePathPatterns : [ '/node_modules/' ] ,
38
33
setupFilesAfterEnv : [ './jest.setup.js' ] ,
39
- // test environment setup
40
- // setupFiles: [`${__dirname}/setup/setup.js`],
41
- // setupFilesAfterEnv: [`${__dirname}/setup/setupAfterEnv.ts`],
42
- // coverage settings
43
34
collectCoverage : true ,
44
35
collectCoverageFrom : [ '**/*.{ts,tsx}' , '!**/*.d.ts' , '!**/node_modules/**' ] ,
45
36
coverageThreshold : {
46
- " global" : {
47
- " branches" : 65 ,
48
- " functions" : 80 ,
49
- " lines" : 80 ,
50
- " statements" : 80
37
+ global : {
38
+ branches : 65 ,
39
+ functions : 80 ,
40
+ lines : 80 ,
41
+ statements : 80
51
42
}
52
43
} ,
53
44
coveragePathIgnorePatterns : [ '/node_modules/' , '\\.json$' , '/__tests__/' , '/stories/' , '/\\.storybook/' ] ,
54
45
55
- globals : {
56
- 'ts -jest' : {
46
+ transform : {
47
+ '^.+\\.(ts|tsx)$' : [ 'ts -jest', {
57
48
tsconfig : `${ __dirname } /tsconfig.json` ,
58
-
59
- // https://huafu.github.io/ts-jest/user/config/diagnostics
60
49
diagnostics : false ,
61
-
62
- // Makes jest test run much faster, BUT, without type checking.
63
- // Type checking in CI is done with `tsc --noEmit` or `yarn typecheck` command.
64
- // https://huafu.github.io/ts-jest/user/config/isolatedModules
65
50
isolatedModules : true ,
66
- } ,
51
+ } ] ,
52
+ '^.+\\.(js|jsx)$' : 'babel-jest' ,
67
53
} ,
68
54
69
55
transformIgnorePatterns : [ '/node_modules/(?!(lodash-es|antd|[^/]+/es|rc-animate|rc-util)/).*' ] ,
70
- transform : {
71
- '\\.(ts|tsx)$' : 'ts-jest' ,
72
- '/node_modules/((lodash-es|[^/]+/es)|rc-animate|rc-util)/.*' : 'ts-jest' ,
73
- } ,
74
- } ;
56
+ } ;
0 commit comments