https://github.com/interviewstreet/enzyme-chai-a11y
Accessibility testing plugin for chai based on axe-core
https://github.com/interviewstreet/enzyme-chai-a11y
Last synced: over 1 year ago
JSON representation
Accessibility testing plugin for chai based on axe-core
- Host: GitHub
- URL: https://github.com/interviewstreet/enzyme-chai-a11y
- Owner: interviewstreet
- License: mit
- Created: 2019-12-18T07:35:19.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T12:30:01.000Z (over 3 years ago)
- Last Synced: 2025-03-08T05:48:11.131Z (over 1 year ago)
- Language: JavaScript
- Size: 3.01 MB
- Stars: 0
- Watchers: 43
- Forks: 1
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# enzyme-chai-a11y
[](https://github.com/diegohaz/nod)
[](https://npmjs.org/package/enzyme-chai-a11y)
[](https://travis-ci.org/) [](https://codecov.io/gh//branch/master)
Accessibility testing plugin for chai based on axe-core
## Install
npm:
npm i enzyme-chai-a11y --save-dev
Yarn:
yarn add enzyme-chai-a11y --dev
## Usage
```js
import auditA11y, { accessible } from "enzyme-chai-a11y";
chai.use(accessible);
it('should not have accessibility violations', async () => {
const results = await auditA11y(
test
);
expect(results).to.be.accessible();
});
```
## API
#### Table of Contents
- [auditA11y](#audita11y)
- [Parameters](#parameters)
### auditA11y
Runs the axe-core on passed component.
#### Parameters
- `app` **[node](https://developer.mozilla.org/docs/Web/API/Node/nextSibling)** node to test
- `config` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** axe-core config (optional, default `{}`)
- `enzymeConfig` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** enzyme config (optional, default `{}`)
## License
MIT © [Vikas Parashar](https://github.com/vikas-parashar)