CheckOps
jest-axe
jest-axe is an MIT-licensed custom Jest matcher that runs axe-core against rendered HTML or components and asserts toHaveNoViolations, with colour contrast checks disabled because JSDOM cannot compute them.
- Accessibility Testing
- Web Testing
- Open source
- Free
- Javascript
- React
- Library
- Unit Testing
- Unit testing
- End-to-end & functional
- Accessibility
Latest public signals
Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.
Introduction
jest-axe is a custom Jest matcher for axe-core, making it easy to add basic accessibility checks to component and unit tests. You render markup (directly or through a library such as React Testing Library), pass the container to axe(), and assert expect(results).toHaveNoViolations(). Failures list each violation with a description and a link to Deque’s guidance.
The README is explicit about limits: colour contrast checks do not work in JSDOM, so they are turned off in jest-axe, and automated checks cannot catch every accessibility problem. configureAxe lets you set default rules, disable specific checks or add custom rules and checks, and options can be passed per call. It requires jest-environment-jsdom (installed alongside Jest), and works with React, Vue, Angular and plain HTML. Version 11.0.0 was released on 26 July 2026. Because it runs at the component level, it is a fast first line of defence that complements browser-based tools such as cypress-axe, Pa11y or Accessibility Insights.
The source code is at NickColley/jest-axe on GitHub under the MIT licence, with about 1,100 stars; the most recent commit was on 2 November 2026.
Features
- Component-level checks: Fast accessibility assertions in unit tests.
- Jest matcher:
toHaveNoViolationswith clear failure output. - Configurable:
configureAxefor rules and custom checks. - Framework-agnostic: React, Vue, Angular or plain HTML.
Pros
- Free to use: Open source under the MIT licence, so the core tool costs nothing to use.
- Actively maintained: The repository had commits as recent as 2 November 2026.
Cons
- No contrast checks: JSDOM cannot compute colours.
- Partial coverage: Layout, focus and visual issues need browser testing.
Usage and Links (Example)
npm install --save-dev jest jest-axe jest-environment-jsdom
/** @jest-environment jsdom */
import { render } from "@testing-library/react";
import { axe, toHaveNoViolations } from "jest-axe";
import { SignupForm } from "./SignupForm";
expect.extend(toHaveNoViolations);
test("signup form has no detectable violations", async () => {
const { container } = render(<SignupForm />);
expect(await axe(container)).toHaveNoViolations();
});
Resources:
Pricing
jest-axe is free and open source under the MIT licence.
Recommended for?
- Front-end teams on Jest wanting accessibility checks in component tests.
- Design systems checking every component automatically.
Conclusion
jest-axe is a lightweight, effective way to catch common accessibility mistakes early in component tests.
Alternatives
Other tools on CheckOps that cover similar ground. Open a page, or compare one with jest-axe side by side.
Aaxe-coreaxe-core is Deque's open-source accessibility rules engine. It checks rendered HTML and reports WCAG violations as JSON.Compare with jest-axe
Ccypress-axecypress-axe is an MIT-licensed set of custom Cypress commands that inject axe-core into the page under test and check for accessibility violations with cy.checkA11y.Compare with jest-axe
TTesting LibraryTesting Library is a family of MIT-licensed packages (DOM, React, Vue, Angular, Svelte, user-event and more) for testing UI the way users use it, querying by role, label and text instead of implementation details.Compare with jest-axe
JJestJest is a free, open-source JavaScript test runner with zero-config defaults, mocks, and snapshot testing.Compare with jest-axe
SStorybook Accessibility AddonStorybook's accessibility addon (@storybook/addon-a11y) runs axe-core checks on every story, showing violations in an Accessibility panel and enabling automated accessibility tests through Storybook's test tooling.Compare with jest-axe
PPa11yPa11y is a free, open-source command-line accessibility checker. It opens a URL in a headless browser and reports rule failures.Compare with jest-axe