Jest / Vitest
Component-level accessibility testing for unit test suites.
Install
Usage
API
| Function | Description |
|---|---|
analyzeDOM(root?) | Analyze rendered DOM. Optional root element to scope. |
matchers.toBeAccessible() | Passes if zero issues found. |
matchers.toHaveNoViolations(severity?) | Filter by severity level. |
What It Checks
- Images without alt text
- Buttons without accessible names
- Form inputs without labels
- Empty links
- Heading hierarchy skips
- Invalid ARIA roles
- Interactive elements without keyboard access
- Missing page language
Vitest
Same API — configure jsdom environment: