https://github.com/ngduc/px-test-utils
helper functions for mocha unit tests using teaspoon, react-addons-test-utils, etc.
https://github.com/ngduc/px-test-utils
Last synced: 12 months ago
JSON representation
helper functions for mocha unit tests using teaspoon, react-addons-test-utils, etc.
- Host: GitHub
- URL: https://github.com/ngduc/px-test-utils
- Owner: ngduc
- Created: 2015-12-19T05:41:02.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-20T18:17:55.000Z (over 10 years ago)
- Last Synced: 2025-05-25T22:16:05.671Z (about 1 year ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# px-test-utils
Helper functions for mocha unit tests using [teaspoon](https://github.com/jquense/teaspoon), react-addons-test-utils, etc.
# Installation
```
npm install px-test-utils --save-dev
```
# Usage
```
import PxTestUtils from 'px-test-utils';
describe('My Component', () => {
let renderer;
let $el;
const reactEl = (
Content);
beforeEach(() => {
[ renderer, $el ] = PxTestUtils.render(reactEl);
});
it('should have 1 div', () => {
expect($el.find('div').length).to.equal(1);
});
})
```
# Why
px-test-utils is just a wrapper to help write shorter, cleaner React unit tests.