From b1476b4e7aaf6fb4349ed469c30f3081b9ac69c9 Mon Sep 17 00:00:00 2001 From: Yen-Chi Chen Date: Thu, 4 Jun 2020 20:02:22 +0200 Subject: [PATCH] migrate function signature --- packages/jest-console/src/getConsoleOutput.ts | 15 +++------------ packages/jest-reporters/src/default_reporter.ts | 8 +------- packages/jest-runner/src/runTest.ts | 2 -- 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/packages/jest-console/src/getConsoleOutput.ts b/packages/jest-console/src/getConsoleOutput.ts index f6f0369f50ee..4c6ba6e13af7 100644 --- a/packages/jest-console/src/getConsoleOutput.ts +++ b/packages/jest-console/src/getConsoleOutput.ts @@ -15,20 +15,11 @@ import type {Config} from '@jest/types'; import type {ConsoleBuffer} from './types'; export default ( - // TODO: remove in 27 - root: string, - // TODO: this is covered by GlobalConfig, switch over in 27 - verbose: boolean, buffer: ConsoleBuffer, - // TODO: make mandatory and take Config.ProjectConfig in 27 - config: StackTraceConfig = { - rootDir: root, - testMatch: [], - }, - // TODO: make mandatory in 27 - globalConfig?: Config.GlobalConfig, + config: StackTraceConfig, + globalConfig: Config.GlobalConfig, ): string => { - const TITLE_INDENT = verbose ? ' ' : ' '; + const TITLE_INDENT = globalConfig.verbose ? ' ' : ' '; const CONSOLE_INDENT = TITLE_INDENT + ' '; const logEntries = buffer.reduce((output, {type, message, origin}) => { diff --git a/packages/jest-reporters/src/default_reporter.ts b/packages/jest-reporters/src/default_reporter.ts index 4f0046b2111f..136a85addf15 100644 --- a/packages/jest-reporters/src/default_reporter.ts +++ b/packages/jest-reporters/src/default_reporter.ts @@ -178,13 +178,7 @@ export default class DefaultReporter extends BaseReporter { ' ' + TITLE_BULLET + 'Console\n\n' + - getConsoleOutput( - config.cwd, - !!this._globalConfig.verbose, - result.console, - config, - this._globalConfig, - ), + getConsoleOutput(result.console, config, this._globalConfig), ); } } diff --git a/packages/jest-runner/src/runTest.ts b/packages/jest-runner/src/runTest.ts index bc73db185c42..a6b4b4a919d4 100644 --- a/packages/jest-runner/src/runTest.ts +++ b/packages/jest-runner/src/runTest.ts @@ -116,8 +116,6 @@ async function runTestInternal( const consoleOut = globalConfig.useStderr ? process.stderr : process.stdout; const consoleFormatter = (type: LogType, message: LogMessage) => getConsoleOutput( - config.cwd, - !!globalConfig.verbose, // 4 = the console call is buried 4 stack frames deep BufferedConsole.write([], type, message, 4), config,