Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davidedaniel/mochachai
https://github.com/davidedaniel/mochachai
Last synced: 20 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/davidedaniel/mochachai
- Owner: DavideDaniel
- License: mit
- Created: 2015-01-25T07:22:40.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-25T08:21:14.000Z (almost 10 years ago)
- Last Synced: 2024-10-13T00:05:31.938Z (about 1 month ago)
- Language: JavaScript
- Size: 274 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# TDD - Test Driven Development tutorial
---Thanks [Collin](https://github.com/cfmeyers) for the intro to TDD =)
Watch [this 8ish minute video](https://www.youtube.com/watch?v=tdNnN5yTIeM) for a quick look into how awesome TDD can be!
####Get started with mocha, chai and test driven development in 5 easy steps!
***Testing with mocha & chai is super easy.
Let's start in whichever root directory you'd like. Keep in mind you'll be making a test dir inside there and also locally installing chai.**Step 1**
Global install mocha
```
$ npm install -g mocha
```**Step 2**
Make a new directory and touch your files...
```
$ mkdir test
$ touch test/testing.js
```**Step 3**
Locally install chai and npm init
```
$ npm init
$ npm install --save chai
```**Step 4**
Let's start testing/developing!
```
$ cd test
$ [youreditor] testing.js
```
Start writing in your test file. You can use terms like describe, it, should, do, be and lots more depending on which library you choose to use.
Check out [ChaiJs styles](http://chaijs.com/guide/styles/) for more language styles.**Step 5**
Once you've completed your test file and are ready to test, cd back out to the root directory and run mocha.
```
$ cd ..
$ mocha
```Your test should tell you if there were any issues and move your development forward.