(target, options = {})
| 216 | } |
| 217 | |
| 218 | async function loadBenchmarkConfig(target, options = {}) { |
| 219 | if (options.configPath) { |
| 220 | const config = readJson(path.resolve(options.configPath)); |
| 221 | return { |
| 222 | config: normalizeConfig(await config, target), |
| 223 | configPath: path.resolve(options.configPath), |
| 224 | source: "file", |
| 225 | }; |
| 226 | } |
| 227 | |
| 228 | const defaultConfigPath = defaultBenchmarkConfigPath(target); |
| 229 | if (await pathExists(defaultConfigPath)) { |
| 230 | const config = await readJson(defaultConfigPath); |
| 231 | return { |
| 232 | config: normalizeConfig(config, target), |
| 233 | configPath: defaultConfigPath, |
| 234 | source: "file", |
| 235 | }; |
| 236 | } |
| 237 | |
| 238 | const generated = await createStarterBenchmarkConfig(target, options); |
| 239 | return { |
| 240 | config: generated, |
| 241 | configPath: null, |
| 242 | source: "generated", |
| 243 | }; |
| 244 | } |
| 245 | |
| 246 | async function runProcessCapture({ |
| 247 | command, |
no test coverage detected