( parsedConfigs: Array<ReadConfig>, projects: Config.GlobalConfig['projects'], )
| 266 | }); |
| 267 | |
| 268 | const ensureNoDuplicateConfigs = ( |
| 269 | parsedConfigs: Array<ReadConfig>, |
| 270 | projects: Config.GlobalConfig['projects'], |
| 271 | ) => { |
| 272 | if (projects.length <= 1) { |
| 273 | return; |
| 274 | } |
| 275 | |
| 276 | const configPathMap = new Map(); |
| 277 | |
| 278 | for (const config of parsedConfigs) { |
| 279 | const {configPath} = config; |
| 280 | |
| 281 | if (configPathMap.has(configPath)) { |
| 282 | const message = `Whoops! Two projects resolved to the same config path: ${chalk.bold( |
| 283 | String(configPath), |
| 284 | )}: |
| 285 | |
| 286 | Project 1: ${chalk.bold(projects[parsedConfigs.indexOf(config)])} |
| 287 | Project 2: ${chalk.bold( |
| 288 | projects[parsedConfigs.indexOf(configPathMap.get(configPath))], |
| 289 | )} |
| 290 | |
| 291 | This usually means that your ${chalk.bold( |
| 292 | '"projects"', |
| 293 | )} config includes a directory that doesn't have any configuration recognizable by Jest. Please fix it. |
| 294 | `; |
| 295 | |
| 296 | throw new Error(message); |
| 297 | } |
| 298 | if (configPath !== null) { |
| 299 | configPathMap.set(configPath, config); |
| 300 | } |
| 301 | } |
| 302 | }; |
| 303 | |
| 304 | export interface ReadJestConfigOptions { |
| 305 | /** |
no test coverage detected