Skip to content

Commit

Permalink
migrate function signature
Browse files Browse the repository at this point in the history
  • Loading branch information
ychi committed Jun 4, 2020
1 parent 068ec04 commit b1476b4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 21 deletions.
15 changes: 3 additions & 12 deletions packages/jest-console/src/getConsoleOutput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}) => {
Expand Down
8 changes: 1 addition & 7 deletions packages/jest-reporters/src/default_reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
);
}
}
Expand Down
2 changes: 0 additions & 2 deletions packages/jest-runner/src/runTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b1476b4

Please sign in to comment.