chai-react-mock
v2.0.0
Published
Chai assertions for react-mock-component
Downloads
7
Readme
Chai plugin for react-mock-component
Usage
import chai from 'chai';
import chaiReactMock from 'chai-react-mock';
import createReactMock from 'react-mock-component';
import React from 'react';
import ReactDOM from 'react-dom';
chai.use(chaiReactMock);
const { expect } = chai;
interface StubProps { foo: string; }
const Stub = createReactMock<StubProps>();
ReactDOM.render(<Stub foo="bar" />);
expect(Stub).to.have.been.rendered
.and.to.have.been.renderedWith({ foo: 'bar' });