UNPKG

1.33 kBJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, '__esModule', {
4 value: true
5});
6exports.default = void 0;
7
8function _chalk() {
9 const data = _interopRequireDefault(require('chalk'));
10
11 _chalk = function () {
12 return data;
13 };
14
15 return data;
16}
17
18function _interopRequireDefault(obj) {
19 return obj && obj.__esModule ? obj : {default: obj};
20}
21
22/**
23 * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
24 *
25 * This source code is licensed under the MIT license found in the
26 * LICENSE file in the root directory of this source tree.
27 */
28const activeFilters = (globalConfig, delimiter = '\n') => {
29 const {testNamePattern, testPathPattern} = globalConfig;
30
31 if (testNamePattern || testPathPattern) {
32 const filters = [
33 testPathPattern
34 ? _chalk().default.dim('filename ') +
35 _chalk().default.yellow('/' + testPathPattern + '/')
36 : null,
37 testNamePattern
38 ? _chalk().default.dim('test name ') +
39 _chalk().default.yellow('/' + testNamePattern + '/')
40 : null
41 ]
42 .filter(f => f)
43 .join(', ');
44 const messages = [
45 '\n' + _chalk().default.bold('Active Filters: ') + filters
46 ];
47 return messages.filter(message => !!message).join(delimiter);
48 }
49
50 return '';
51};
52
53var _default = activeFilters;
54exports.default = _default;