MCPcopy Index your code
hub / github.com/code-pushup/cli / runForUrl

Function runForUrl

packages/plugin-axe/src/lib/runner/runner.ts:60–83  ·  view source on GitHub ↗
(
  runner: AxeRunner,
  args: AxeUrlArgs,
)

Source from the content-addressed store, hash-verified

58}
59
60async function runForUrl(
61 runner: AxeRunner,
62 args: AxeUrlArgs,
63): Promise<AxeUrlResult | null> {
64 const { url, urlsCount, urlIndex } = args;
65 try {
66 const result = await runner.analyzeUrl(args);
67
68 if (shouldExpandForUrls(urlsCount)) {
69 return {
70 ...result,
71 auditOutputs: result.auditOutputs.map(audit => ({
72 ...audit,
73 slug: addIndex(audit.slug, urlIndex),
74 })),
75 };
76 }
77
78 return result;
79 } catch (error) {
80 logger.warn(`Axe execution failed for ${url}: ${stringifyError(error)}`);
81 return null;
82 }
83}
84
85function logResultsForAllUrls(results: AxeUrlResult[]): void {
86 logger.info(

Callers 1

createRunnerFunctionFunction · 0.85

Calls 5

shouldExpandForUrlsFunction · 0.90
addIndexFunction · 0.90
stringifyErrorFunction · 0.90
analyzeUrlMethod · 0.80
warnMethod · 0.80

Tested by

no test coverage detected