diff --git a/packages/jest-config/src/normalize.ts b/packages/jest-config/src/normalize.ts index 4a1f9c681e64..100b4338cc06 100644 --- a/packages/jest-config/src/normalize.ts +++ b/packages/jest-config/src/normalize.ts @@ -1010,6 +1010,8 @@ export default function normalize( } newOptions.collectCoverageFrom = collectCoverageFrom; + } else if (!newOptions.collectCoverageFrom) { + newOptions.collectCoverageFrom = []; } return { diff --git a/packages/jest-runtime/src/index.ts b/packages/jest-runtime/src/index.ts index bbffd575bbd5..e56d5c3ca113 100644 --- a/packages/jest-runtime/src/index.ts +++ b/packages/jest-runtime/src/index.ts @@ -178,14 +178,7 @@ class Runtime { } } - // TODO: Make this `static shouldInstrument = shouldInstrument;` after https://github.com/facebook/jest/issues/7846 - static shouldInstrument( - filename: Config.Path, - options: ShouldInstrumentOptions, - config: Config.ProjectConfig, - ) { - return shouldInstrument(filename, options, config); - } + static shouldInstrument = shouldInstrument; static createContext( config: Config.ProjectConfig,