Skip to content

Commit 97c41f3

Browse files
authored
chore: simplify "active filters" in CLI output (#14461)
1 parent 5611a1d commit 97c41f3

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

packages/jest-core/src/lib/activeFiltersMessage.ts

+5-7
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@
77

88
import chalk = require('chalk');
99
import type {Config} from '@jest/types';
10+
import {isNonNullable} from 'jest-util';
1011

11-
const activeFilters = (
12-
globalConfig: Config.GlobalConfig,
13-
delimiter = '\n',
14-
): string => {
12+
const activeFilters = (globalConfig: Config.GlobalConfig): string => {
1513
const {testNamePattern, testPathPattern} = globalConfig;
1614
if (testNamePattern || testPathPattern) {
1715
const filters = [
@@ -22,12 +20,12 @@ const activeFilters = (
2220
? chalk.dim('test name ') + chalk.yellow(`/${testNamePattern}/`)
2321
: null,
2422
]
25-
.filter(f => f)
23+
.filter(isNonNullable)
2624
.join(', ');
2725

28-
const messages = [`\n${chalk.bold('Active Filters: ')}${filters}`];
26+
const messages = `\n${chalk.bold('Active Filters: ')}${filters}`;
2927

30-
return messages.filter(message => !!message).join(delimiter);
28+
return messages;
3129
}
3230

3331
return '';

0 commit comments

Comments
 (0)