1
1
import type { Config } from 'jest' ;
2
2
import nextJest from 'next/jest.js' ;
3
3
4
- const esModules = [ 'query-string' , 'decode-uri-component' , 'split-on-first' , 'filter-obj' ]
4
+ const esModules = [
5
+ 'query-string' ,
6
+ 'decode-uri-component' ,
7
+ 'split-on-first' ,
8
+ 'filter-obj' ,
9
+ ] ;
5
10
6
11
const createJestConfig = nextJest ( {
7
12
dir : './' ,
8
- } )
13
+ } ) ;
9
14
const config : Config = {
10
15
displayName : {
11
16
color : 'cyan' ,
@@ -17,16 +22,19 @@ const config: Config = {
17
22
} ,
18
23
rootDir : '../../' ,
19
24
preset : 'ts-jest' ,
20
- setupFilesAfterEnv : [ "<rootDir>/jest/node/jest.setup.ts" ] ,
21
- testEnvironment : "node" ,
22
- testMatch : [
23
- "**/__tests__/**/*.node.ts"
25
+ setupFilesAfterEnv : [ '<rootDir>/jest/node/jest.setup.ts' ] ,
26
+ testEnvironment : 'node' ,
27
+ testMatch : [ '**/__tests__/**/*.node.ts' ] ,
28
+ coveragePathIgnorePatterns : [
29
+ '/node_modules/' ,
30
+ 'src/test-utils' ,
31
+ '/__fixtures__/' ,
32
+ '\\.config\\.ts$' ,
24
33
] ,
25
34
transformIgnorePatterns : [ `/node_modules/(?!(${ esModules . join ( '|' ) } )/)` ] ,
26
35
} ;
27
-
28
36
29
- const getCustomizedConfig = async ( ) => {
37
+ const getCustomizedConfig = async ( ) => {
30
38
const jestConfig = await createJestConfig ( config ) ( ) ;
31
39
return {
32
40
...jestConfig ,
@@ -35,7 +43,7 @@ const getCustomizedConfig= async () => {
35
43
transformIgnorePatterns : jestConfig . transformIgnorePatterns ?. filter (
36
44
( ptn ) => ptn !== '/node_modules/'
37
45
) ,
38
- }
39
- }
46
+ } ;
47
+ } ;
40
48
// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
41
- export default getCustomizedConfig
49
+ export default getCustomizedConfig ;
0 commit comments