https://github.com/nighttrax/chai-react-mock
Chai plugin for react-mock-component
https://github.com/nighttrax/chai-react-mock
Last synced: 6 months ago
JSON representation
Chai plugin for react-mock-component
- Host: GitHub
- URL: https://github.com/nighttrax/chai-react-mock
- Owner: NiGhTTraX
- Created: 2019-03-07T22:17:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T19:45:47.000Z (over 2 years ago)
- Last Synced: 2025-03-09T16:37:27.951Z (7 months ago)
- Language: TypeScript
- Size: 335 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
> Chai plugin for [react-mock-component](https://github.com/NiGhTTraX/react-mock-component)
[](https://travis-ci.com/NiGhTTraX/chai-react-mock) [](https://codecov.io/gh/NiGhTTraX/chai-react-mock) 
----
## Usage
```typescript jsx
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();ReactDOM.render();
expect(Stub).to.have.been.rendered
.and.to.have.been.renderedWith({ foo: 'bar' });
```