11import type { Config } from 'jest' ;
22import nextJest from 'next/jest.js' ;
33
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+ ] ;
510
611const createJestConfig = nextJest ( {
712 dir : './' ,
8- } )
13+ } ) ;
914const config : Config = {
1015 displayName : {
1116 color : 'cyan' ,
@@ -17,16 +22,19 @@ const config: Config = {
1722 } ,
1823 rootDir : '../../' ,
1924 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$' ,
2433 ] ,
2534 transformIgnorePatterns : [ `/node_modules/(?!(${ esModules . join ( '|' ) } )/)` ] ,
2635} ;
27-
2836
29- const getCustomizedConfig = async ( ) => {
37+ const getCustomizedConfig = async ( ) => {
3038 const jestConfig = await createJestConfig ( config ) ( ) ;
3139 return {
3240 ...jestConfig ,
@@ -35,7 +43,7 @@ const getCustomizedConfig= async () => {
3543 transformIgnorePatterns : jestConfig . transformIgnorePatterns ?. filter (
3644 ( ptn ) => ptn !== '/node_modules/'
3745 ) ,
38- }
39- }
46+ } ;
47+ } ;
4048// 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