1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, '__esModule', {
|
4 | value: true
|
5 | });
|
6 | exports.default = void 0;
|
7 |
|
8 | function _jestChangedFiles() {
|
9 | const data = require('jest-changed-files');
|
10 |
|
11 | _jestChangedFiles = function () {
|
12 | return data;
|
13 | };
|
14 |
|
15 | return data;
|
16 | }
|
17 |
|
18 | function _jestMessageUtil() {
|
19 | const data = require('jest-message-util');
|
20 |
|
21 | _jestMessageUtil = function () {
|
22 | return data;
|
23 | };
|
24 |
|
25 | return data;
|
26 | }
|
27 |
|
28 | function _chalk() {
|
29 | const data = _interopRequireDefault(require('chalk'));
|
30 |
|
31 | _chalk = function () {
|
32 | return data;
|
33 | };
|
34 |
|
35 | return data;
|
36 | }
|
37 |
|
38 | function _interopRequireDefault(obj) {
|
39 | return obj && obj.__esModule ? obj : {default: obj};
|
40 | }
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 | var _default = (globalConfig, configs) => {
|
49 | if (globalConfig.onlyChanged) {
|
50 | const allRootsForAllProjects = configs.reduce((roots, config) => {
|
51 | if (config.roots) {
|
52 | roots.push(...config.roots);
|
53 | }
|
54 |
|
55 | return roots;
|
56 | }, []);
|
57 | return (0, _jestChangedFiles().getChangedFilesForRoots)(
|
58 | allRootsForAllProjects,
|
59 | {
|
60 | changedSince: globalConfig.changedSince,
|
61 | lastCommit: globalConfig.lastCommit,
|
62 | withAncestor: globalConfig.changedFilesWithAncestor
|
63 | }
|
64 | ).catch(e => {
|
65 | const message = (0, _jestMessageUtil().formatExecError)(e, configs[0], {
|
66 | noStackTrace: true
|
67 | })
|
68 | .split('\n')
|
69 | .filter(line => !line.includes('Command failed:'))
|
70 | .join('\n');
|
71 | console.error(_chalk().default.red(`\n\n${message}`));
|
72 | process.exit(1);
|
73 | });
|
74 | }
|
75 |
|
76 | return undefined;
|
77 | };
|
78 |
|
79 | exports.default = _default;
|