Skip to content

Commit

Permalink
Import full axe object to work around dequelabs/axe-core#4458
Browse files Browse the repository at this point in the history
  • Loading branch information
acelaya committed May 13, 2024
1 parent 58bb85e commit 0258121
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/__helpers__/accessibility.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { run } from 'axe-core';
import axe from 'axe-core';

type ContainerWrapper = { container: HTMLElement };

type AccessibilityTestSubject = ContainerWrapper | Promise<ContainerWrapper>;

export const checkAccessibility = async (subject: AccessibilityTestSubject) => {
const { container } = await subject;
const { violations } = await run(container);
const { violations } = await axe.run(container);

expect(violations).toStrictEqual([]);
};

0 comments on commit 0258121

Please sign in to comment.