(
{ passes, violations, incomplete, inapplicable }: axe.AxeResults,
url: string,
)
| 16 | * Priority: violations > incomplete > passes > inapplicable |
| 17 | */ |
| 18 | export function toAuditOutputs( |
| 19 | { passes, violations, incomplete, inapplicable }: axe.AxeResults, |
| 20 | url: string, |
| 21 | ): AuditOutputs { |
| 22 | const toEntries = (results: axe.Result[], score: number) => |
| 23 | results.map(res => [res.id, toAuditOutput(res, url, score)] as const); |
| 24 | |
| 25 | return [ |
| 26 | ...new Map<string, AuditOutput>([ |
| 27 | ...toEntries(inapplicable, 1), |
| 28 | ...toEntries(passes, 1), |
| 29 | ...toEntries(incomplete, 0), |
| 30 | ...toEntries(violations, 0), |
| 31 | ]).values(), |
| 32 | ]; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * For failing audits (score 0), includes detailed issues with locations and severities. |
no test coverage detected