MCPcopy Create free account
hub / github.com/adobe/react-spectrum / formatAxeResults

Function formatAxeResults

packages/dev/s2-docs/scripts/testAccessibility.mjs:175–200  ·  view source on GitHub ↗
(results, url, ignoredRules = new Set())

Source from the content-addressed store, hash-verified

173
174// Format Axe results for display
175function formatAxeResults(results, url, ignoredRules = new Set()) {
176 let violations = results.violations;
177
178 // Filter out known false positives
179 violations = filterFalsePositives(violations, ignoredRules);
180
181 if (violations.length === 0) {
182 return null;
183 }
184
185 return {
186 url,
187 violations: violations.map(v => ({
188 id: v.id,
189 impact: v.impact,
190 description: v.description,
191 help: v.help,
192 helpUrl: v.helpUrl,
193 nodes: v.nodes.map(n => ({
194 html: n.html.slice(0, 200),
195 target: n.target,
196 failureSummary: n.failureSummary
197 }))
198 }))
199 };
200}
201
202// Main test function
203async function testAccessibility() {

Callers 1

testAccessibilityFunction · 0.85

Calls 2

filterFalsePositivesFunction · 0.85
sliceMethod · 0.80

Tested by

no test coverage detected