1+ /** @typedef {import('@jest/types').Config.InitialOptions } JestConfig */
2+
13const { ifAnyDep, hasAnyDep, hasFile, fromRoot} = require ( '../utils' )
24
35const ignores = [
@@ -16,6 +18,7 @@ const testMatchSuffixGlob = toGlob(
1618 testMatchExtensions . map ( extension => 'test.' . concat ( extension ) ) ,
1719)
1820
21+ /** @type JestConfig */
1922const jestConfig = {
2023 roots : [ fromRoot ( '.' ) ] ,
2124 testEnvironment : ifAnyDep ( [ 'webpack' , 'rollup' , 'react' ] , 'jsdom' , 'node' ) ,
@@ -29,9 +32,17 @@ const jestConfig = {
2932 `e2e/**/${ testMatchSuffixGlob } ` ,
3033 `**/${ testMatchSuffixGlob } ` ,
3134 ] ,
32- testPathIgnorePatterns : [ ...ignores ] ,
33- coveragePathIgnorePatterns : [ ...ignores , 'src/(umd|cjs|esm)-entry.js$' ] ,
34- transformIgnorePatterns : [ '[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$' ] ,
35+ testPathIgnorePatterns : [ ...ignores , '<rootDir>/dist' ] ,
36+ coveragePathIgnorePatterns : [
37+ ...ignores ,
38+ 'src/(umd|cjs|esm)-entry.js$' ,
39+ '<rootDir>/dist' ,
40+ ] ,
41+ transformIgnorePatterns : [
42+ '[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$' ,
43+ '/dist/' ,
44+ ] ,
45+ watchPathIgnorePatterns : [ '<rootDir>/dist' ] ,
3546 coverageThreshold : {
3647 global : {
3748 branches : 100 ,
0 commit comments