MCPcopy
hub / github.com/jestjs/jest / getChangedFilesPromise

Function getChangedFilesPromise

packages/jest-core/src/getChangedFilesPromise.ts:16–41  ·  view source on GitHub ↗
(
  globalConfig: Config.GlobalConfig,
  configs: Array<Config.ProjectConfig>,
)

Source from the content-addressed store, hash-verified

14import {formatExecError} from 'jest-message-util';
15
16export 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}

Callers 2

startRunFunction · 0.85
_run10000Function · 0.85

Calls 4

getChangedFilesForRootsFunction · 0.90
formatExecErrorFunction · 0.90
catchMethod · 0.80
errorMethod · 0.45

Tested by

no test coverage detected