We can add accessibility testing to our jest
unit tests with jest-axe
which gives us:
- An easy way to automate accessibility auditing.
- The flexibility to audit at any level of our code, as low as an element and as high as a component representing an entire page of our app.
- A safety net for any accessibility regressions.
Here we'll see how to use jest-axe
with ReactDOM
to render components for jest-axe
to audit for accessibility.
Resources
- https://github.com/nickcolley/jest-axe