https://github.com/anyulled/tdd_react
⚛ Test Driven Development with Reactjs
https://github.com/anyulled/tdd_react
assertions chai enzyme mocha quik reactjs test-driven-development
Last synced: 3 months ago
JSON representation
⚛ Test Driven Development with Reactjs
- Host: GitHub
- URL: https://github.com/anyulled/tdd_react
- Owner: anyulled
- Created: 2016-11-27T13:54:31.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-09-27T13:26:13.000Z (10 months ago)
- Last Synced: 2025-09-27T15:22:01.273Z (10 months ago)
- Topics: assertions, chai, enzyme, mocha, quik, reactjs, test-driven-development
- Language: JavaScript
- Homepage:
- Size: 62.5 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Test Driven Development with ReactJs
[](https://gemnasium.com/github.com/anyulled/tdd_react)
## Prerequisites
- NodeJs
- npm
## Environment
- Quik [web](https://www.npmjs.com/package/quik)
### Test Runner
- **Mocha**: it's the top-level tool responsible for finding and loading test files, trnaspiling them, and running the test code itself: the `describe` and `it` blocks that compose the tests.
- **Chai**: is the assertion library. It supplies the `expect` and `assert` calls we'll use in the tests to verify everything is working correctly. [web](http://chaijs.com/api/)
- **Sinon**: is a library for creating and inspecting spies. _Spies_ let you mock and stub pieces of functionality in order to keep the tests focused on the component under test. [web](http://sinonjs.org/docs/)
- **Enzyme**: is a library for rendering and making assertions on React components. [web](http://airbnb.io/enzyme/docs/api/index.html)
### Testing workflow
1. Run `mocha` at the command line, wit some arguments.
2. Mocha finds the test files and transpiles them.
3. Mocha executes the tests, which are writeen in Javascript (EcmaScript 6).
4. Each test will `import` _enzyme_ and _chai_, then use them to render components and make assertions.
#### Getting started
1. Install module dependencies with `npm install`
2. Install Quik `npm i -g quik`
3. Install Mocha `npm i -g mocha`
4. To run your test, simply type `npm test`
5. Run `npm start` to start the app.