({ args })
| 409 | }, |
| 410 | }, |
| 411 | async run({ args }) { |
| 412 | const project = resolveProject(args.dir); |
| 413 | const timeout = parseInt(args.timeout as string, 10) || 3000; |
| 414 | const useContrast = args.contrast ?? true; |
| 415 | const asJson = Boolean(args.json); |
| 416 | |
| 417 | if (!asJson) { |
| 418 | console.log(`${c.accent("◆")} Validating ${c.accent(project.name)} in headless Chrome`); |
| 419 | } |
| 420 | |
| 421 | try { |
| 422 | const result = await validateInBrowser(project, { timeout, contrast: useContrast }); |
| 423 | const exitCode = printValidationResult(result, asJson); |
| 424 | process.exit(exitCode); |
| 425 | } catch (err: unknown) { |
| 426 | const message = normalizeErrorMessage(err); |
| 427 | emitFailureReport(message, asJson); |
| 428 | process.exit(1); |
| 429 | } |
| 430 | }, |
| 431 | }); |
| 432 | |
| 433 | function printValidationResult( |
nothing calls this directly
no test coverage detected