0.0.9 • Published 3 years ago

enzyme-chai-a11y v0.0.9

Weekly downloads
4
License
MIT
Repository
github
Last release
3 years ago

enzyme-chai-a11y

Generated with nod NPM version Build Status Coverage Status

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

import auditA11y, { accessible } from "enzyme-chai-a11y";
chai.use(accessible);

it('should not have accessibility violations', async () => {
    const results = await auditA11y(<p>test</p>);
    expect(results).to.be.accessible();
});

API

Table of Contents

auditA11y

Runs the axe-core on passed component.

Parameters

  • app node node to test
  • config object axe-core config (optional, default {})
  • enzymeConfig object enzyme config (optional, default {})

License

MIT © Vikas Parashar