@@ -7,6 +7,21 @@ const packages = fs
77
88const docsSrc = '<rootDir>/packages/documentation/src' ;
99
10+ const isWatchMode = / ( - w | - - w a t c h ) ( \s ? .+ ) ? $ / . test ( process . argv ) ;
11+
12+ let collectCoverageFrom = [ ] ;
13+ if ( ! isWatchMode ) {
14+ collectCoverageFrom = [
15+ '<rootDir>/packages/*/src/**/*.{ts,tsx}' ,
16+ // internal usage and don't matter for the library coverage reports
17+ '!<rootDir>/packages/{dev-utils,documentation,material-icons,react-md}/src/**/*' ,
18+ // these are generated files
19+ '!<rootDir>/packages/*/src/scssVariables.ts' ,
20+ // index.ts files are always `export * from "./fileOrFolder"`
21+ '!<rootDir>/packages/**/index.ts' ,
22+ ] ;
23+ }
24+
1025module . exports = {
1126 preset : 'ts-jest' ,
1227 testEnvironment : 'jsdom' ,
@@ -31,15 +46,7 @@ module.exports = {
3146 '^pages/(.*)$' : `${ docsSrc } /pages/$1` ,
3247 '^utils/(.*)$' : `${ docsSrc } /utils/$1` ,
3348 } ,
34- collectCoverageFrom : [
35- '<rootDir>/packages/*/src/**/*.{ts,tsx}' ,
36- // internal usage and don't matter for the library coverage reports
37- '!<rootDir>/packages/{dev-utils,documentation,material-icons,react-md}/src/**/*' ,
38- // these are generated files
39- '!<rootDir>/packages/*/src/scssVariables.ts' ,
40- // index.ts files are always `export * from "./fileOrFolder"`
41- '!<rootDir>/packages/**/index.ts' ,
42- ] ,
49+ collectCoverageFrom,
4350 watchPlugins : [
4451 'jest-watch-typeahead/filename' ,
4552 'jest-watch-typeahead/testname' ,
0 commit comments