NickColley / jest-axe

Custom Jest matcher for aXe for testing accessibility ♿️🃏
MIT License
1.06k stars 54 forks source link

Do you have a code sample that fail with jest-axe but won't be catch by jsx-a11y eslint plugin? #157

Closed edouard-lopez closed 3 years ago

edouard-lopez commented 3 years ago

Thanks for the lib, I love it!

I would like to demonstrate the package to my teammates, but I need a convincing example. The one on the doc using <img> tag with an alt attribute is already catched by eslint-plugin-jsx-a11y in the IDE.

Could you provide a React/HTML snippet that would trigger jest-axe but not jsx-a11y?

damianpoole commented 3 years ago

On quick inspection, it looks like jsx-a11y uses axe under the hood so I would expect both this and jsx-ally to fail tests for the same issues.

NickColley commented 3 years ago

Yeah think if all your teammates are using the same plugin then maybe you wont get much from this package, however there's a good chance they dont so thats where having it checked by your continuous integration build is useful.