1
+ /** @typedef {import('@jest/types').Config.InitialOptions } JestConfig */
2
+
1
3
const { ifAnyDep, hasAnyDep, hasFile, fromRoot} = require ( '../utils' )
2
4
3
5
const ignores = [
@@ -16,6 +18,7 @@ const testMatchSuffixGlob = toGlob(
16
18
testMatchExtensions . map ( extension => 'test.' . concat ( extension ) ) ,
17
19
)
18
20
21
+ /** @type JestConfig */
19
22
const jestConfig = {
20
23
roots : [ fromRoot ( '.' ) ] ,
21
24
testEnvironment : ifAnyDep ( [ 'webpack' , 'rollup' , 'react' ] , 'jsdom' , 'node' ) ,
@@ -29,9 +32,17 @@ const jestConfig = {
29
32
`e2e/**/${ testMatchSuffixGlob } ` ,
30
33
`**/${ testMatchSuffixGlob } ` ,
31
34
] ,
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' ] ,
35
46
coverageThreshold : {
36
47
global : {
37
48
branches : 100 ,
0 commit comments