diff --git a/packages/jest-cli/src/run_jest.js b/packages/jest-cli/src/run_jest.js index 2fb62db2b255..585872f45266 100644 --- a/packages/jest-cli/src/run_jest.js +++ b/packages/jest-cli/src/run_jest.js @@ -109,10 +109,14 @@ const processResults = (runResults, options) => { onComplete, outputStream, testResultsProcessor, - whyRunning = () => {}, + whyRunning, } = options; - runResults.openHandles = formatWhyRunning(whyRunning); + if (whyRunning) { + runResults.openHandles = formatWhyRunning(whyRunning); + } else { + runResults.openHandles = []; + } if (testResultsProcessor) { /* $FlowFixMe */