chai-have-react-component

3.0.0 • Public • Published

chai-have-react-component

expect(element).to.have.component(Blink)

Installation

npm install --save-dev chai-have-react-component

Usage

import chai from 'chai'
import chaiHaveReactComponent from "chai-have-react-component"
 
chai.use(chaiHaveReactComponent)
 
// it should pass
expect(<div><Super /></div>).to.have.component(Super)
 
// should fail with "Expected 'div' to not have component 'SuperDuper'"
expect(<div><Super /></div>).to.not.have.component(Super)

Found a bug?

Please open a pr with a broken test.


MIT © Rolf Erik Lekang

Readme

Keywords

Package Sidebar

Install

npm i chai-have-react-component

Weekly Downloads

0

Version

3.0.0

License

MIT

Last publish

Collaborators

  • havardh
  • relekang