Skip to content

junyper/chai-enzyme-axe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A chai assertion for enzyme objects using axe-core

Resources

License

Stars

Watchers

Forks

Packages

No packages published