@@ -4,31 +4,34 @@ const { argv } = process;
44 * - The first two are `node` and `jest` URLs
55 * - Anything with `--` is an inline property such as `--watch` and `--detectOpenHandles`
66 */
7- const specific = argv . slice ( 2 , argv . length ) . filter ( ( value ) => value . indexOf ( "--" ) === - 1 ) ;
7+ const specific = argv
8+ . slice ( 2 , argv . length )
9+ . filter ( ( value ) => value . indexOf ( "--" ) === - 1 ) ;
810
911const collectCoverageFrom = [ ] ;
1012const testMatch = [ ] ;
1113
1214function extractSpecifics ( injectTo ) {
13- return specific . map ( ( item ) => injectTo . replace ( "%inject%" , item ) )
15+ return specific . map ( ( item ) => injectTo . replace ( "%inject%" , item ) ) ;
1416}
1517
1618if ( specific . length ) {
1719 collectCoverageFrom . push ( ...extractSpecifics ( "src/**/%inject%.(ts|js)" ) ) ;
18- testMatch . push ( ...extractSpecifics ( "**/%inject%.test.(ts|js)" ) )
20+ testMatch . push ( ...extractSpecifics ( "**/%inject%.test.(ts|js)" ) ) ;
1921} else {
2022 collectCoverageFrom . push ( "src/**/*.(ts|js)" ) ;
2123 testMatch . push ( "**/*.test.(ts|js)" ) ;
2224}
2325
24- collectCoverageFrom . push ( "!src/index.js" ) ;
26+ collectCoverageFrom . push ( "!src/index.(ts|js)" ) ;
27+ collectCoverageFrom . push ( "!src/**/index.(ts|js)" ) ;
2528
2629module . exports = {
2730 setupFilesAfterEnv : [ "<rootDir>/setupTests.js" ] ,
2831 testEnvironment : "jsdom" ,
2932 testMatch,
3033 modulePaths : [ "<rootDir>/node_modules" ] ,
31- globals : { " NODE_ENV" : "test" } ,
34+ globals : { NODE_ENV : "test" } ,
3235 verbose : true ,
3336 moduleFileExtensions : [ "ts" , "js" , "json" ] ,
3437 transform : { "^.+\\.ts$" : "ts-jest" } ,
@@ -38,5 +41,5 @@ module.exports = {
3841 collectCoverage : true ,
3942 collectCoverageFrom,
4043 coverageDirectory : "./coverage" ,
41- coverageReporters : [ "json" , "lcov" , "text" ]
42- } ;
44+ coverageReporters : [ "json" , "lcov" , "text" ] ,
45+ } ;
0 commit comments