Created
May 26, 2018 01:15
-
-
Save olarclara/acb2ca69e0d82292bdcf156ce2448384 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { renderToString } from 'react-dom/server'; | |
import { axe, toHaveNoViolations } from 'jest-axe'; | |
import Component from '/path'; | |
expect.extend(toHaveNoViolations); | |
it('should have no a11y violations', async () => { | |
const wrapper = renderToString(<Component />); | |
const results = await axe(wrapper); | |
expect(results).toHaveNoViolations; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment