Skip to content

Commit

Permalink
Merge pull request #10 from hypothesis/pretty-print-a11y-violation
Browse files Browse the repository at this point in the history
JSON-stringify accessibility violations before console-logging them
  • Loading branch information
acelaya authored Oct 27, 2023
2 parents 7fd8b61 + e1f0483 commit 08ec20c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/accessibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function checkAccessibility(

const violations = await testScenario(elementOrWrapper);
for (const violation of violations) {
console.error('axe-core violation', violation);
console.error('axe-core violation', JSON.stringify(violation, null, 2));
}
if (violations.length > 0) {
throw new Error(`Scenario "${name}" has accessibility violations`);
Expand Down

0 comments on commit 08ec20c

Please sign in to comment.