1.0.2 • Published 7 years ago

chai-enzyme-axe v1.0.2

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

npm

chai-enzyme-axe

A chai assertion that runs axe-core on an enzyme wrapper object to test for a11y violations.

Installation

npm install chai-enzyme-axe

Follow the instructions on using axe-core.

Usage

import chai from 'chai'
import ChaiEnzymeAxe from 'chai-enzyme-axe'

chai.use(ChaiEnzymeAxe)
import {mount, render, shallow} from 'enzyme'

class Fixture extends React.Component {
  render () {
    return (
      <div>
        <label for="name">Name</label>
        <input type="text" id="name" />
      </div>
    )
  }
}

const wrapper = mount(<Fixture />)

wrapper.should.be.accessible(done)

License

MIT

1.0.2

7 years ago

1.0.1

7 years ago