jest-axe
A library that runs axe-core in Jest-style tests and adds the toHaveNoViolations matcher.
In more detail
A test renders a component, calls axe on the container and asserts expect(results).toHaveNoViolations(). The failure message lists each violation, so accessibility regressions fail the test run.
Related terms
- axe-core — An open-source accessibility testing engine by Deque that checks rendered HTML against rules mapped to WCAG success criteria.
- matcher — A function used in a test assertion, such as toBe or toHaveNoViolations, that checks a value and explains any mismatch.
- Testing Library — A family of testing libraries that render components and query them the way users find them, by role, label and text.
Taught in
- Automated Accessibility Testing: axe-core & Testing Library — Design Systems & Component Engineering