From 6e7347eb2bb5d5e168615c951d286fb47ca6ce05 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Sun, 17 Nov 2019 20:11:54 +0100 Subject: [PATCH] always set collectCoverageFrom --- packages/jest-config/src/normalize.ts | 2 ++ packages/jest-runtime/src/index.ts | 9 +-------- 2 files changed, 3 insertions(+), 8 deletions(-) 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,