( configs: Array<Config.ProjectConfig>, globalConfig: Config.GlobalConfig, outputStream: WriteStream, )
| 141 | } |
| 142 | |
| 143 | const buildContextsAndHasteMaps = async ( |
| 144 | configs: Array<Config.ProjectConfig>, |
| 145 | globalConfig: Config.GlobalConfig, |
| 146 | outputStream: WriteStream, |
| 147 | ) => { |
| 148 | const hasteMapInstances = Array.from<IHasteMap>({ |
| 149 | length: configs.length, |
| 150 | }); |
| 151 | const contexts = await Promise.all( |
| 152 | configs.map(async (config, index) => { |
| 153 | createDirectory(config.cacheDirectory); |
| 154 | const hasteMapInstance = await Runtime.createHasteMap(config, { |
| 155 | console: new CustomConsole(outputStream, outputStream), |
| 156 | maxWorkers: Math.max( |
| 157 | 1, |
| 158 | Math.floor(globalConfig.maxWorkers / configs.length), |
| 159 | ), |
| 160 | resetCache: !config.cache, |
| 161 | watch: globalConfig.watch || globalConfig.watchAll, |
| 162 | watchman: globalConfig.watchman, |
| 163 | workerThreads: globalConfig.workerThreads, |
| 164 | }); |
| 165 | hasteMapInstances[index] = hasteMapInstance; |
| 166 | return createContext(config, await hasteMapInstance.build()); |
| 167 | }), |
| 168 | ); |
| 169 | |
| 170 | return {contexts, hasteMapInstances}; |
| 171 | }; |
| 172 | |
| 173 | const _run10000 = async ( |
| 174 | globalConfig: Config.GlobalConfig, |
no test coverage detected