@@ -25,50 +25,32 @@ module.exports = {
2525 verbose : true ,
2626 cacheDirectory : '<rootDir>/tmp/jest' ,
2727 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
3128 testMatch : [ '**/src/tests/*.test.(ts|tsx)' ] ,
3229 testPathIgnorePatterns : [ '/node_modules/' , '/tmp/' , '/coverage/' , '/stories/' , '/\\.storybook/' ] ,
33- // don't watch for file changes in node_modules
3430 watchPathIgnorePatterns : [ '/node_modules/' ] ,
35- // jest automock settings
3631 automock : false ,
3732 unmockedModulePathPatterns : [ '/node_modules/' ] ,
3833 setupFilesAfterEnv : [ './jest.setup.js' ] ,
39- // test environment setup
40- // setupFiles: [`${__dirname}/setup/setup.js`],
41- // setupFilesAfterEnv: [`${__dirname}/setup/setupAfterEnv.ts`],
42- // coverage settings
4334 collectCoverage : true ,
4435 collectCoverageFrom : [ '**/*.{ts,tsx}' , '!**/*.d.ts' , '!**/node_modules/**' ] ,
4536 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
5142 }
5243 } ,
5344 coveragePathIgnorePatterns : [ '/node_modules/' , '\\.json$' , '/__tests__/' , '/stories/' , '/\\.storybook/' ] ,
5445
55- globals : {
56- 'ts -jest' : {
46+ transform : {
47+ '^.+\\.(ts|tsx)$' : [ 'ts -jest', {
5748 tsconfig : `${ __dirname } /tsconfig.json` ,
58-
59- // https://huafu.github.io/ts-jest/user/config/diagnostics
6049 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
6550 isolatedModules : true ,
66- } ,
51+ } ] ,
52+ '^.+\\.(js|jsx)$' : 'babel-jest' ,
6753 } ,
6854
6955 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