( globalConfig: Config.GlobalConfig, configs: Array<Config.ProjectConfig>, )
| 14 | import {formatExecError} from 'jest-message-util'; |
| 15 | |
| 16 | export default function getChangedFilesPromise( |
| 17 | globalConfig: Config.GlobalConfig, |
| 18 | configs: Array<Config.ProjectConfig>, |
| 19 | ): ChangedFilesPromise | undefined { |
| 20 | if (globalConfig.onlyChanged) { |
| 21 | const allRootsForAllProjects = new Set( |
| 22 | configs.flatMap(config => config.roots || []), |
| 23 | ); |
| 24 | return getChangedFilesForRoots([...allRootsForAllProjects], { |
| 25 | changedSince: globalConfig.changedSince, |
| 26 | lastCommit: globalConfig.lastCommit, |
| 27 | withAncestor: globalConfig.changedFilesWithAncestor, |
| 28 | }).catch(error => { |
| 29 | const message = formatExecError(error, configs[0], {noStackTrace: true}) |
| 30 | .split('\n') |
| 31 | .filter(line => !line.includes('Command failed:')) |
| 32 | .join('\n'); |
| 33 | |
| 34 | console.error(chalk.red(`\n\n${message}`)); |
| 35 | |
| 36 | process.exit(1); |
| 37 | }); |
| 38 | } |
| 39 | |
| 40 | return undefined; |
| 41 | } |
no test coverage detected