Render Components with ReactDOM to Write Tests with Jest and jest-axe

InstructorErin Doyle

Share this video with your friends

Send Tweet

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