Add mocha TDD interface cheatsheet

Also add extra links
This commit is contained in:
Jordan Klassen 2015-10-05 13:44:34 -07:00
parent 62a524d54c
commit 7683181b74
2 changed files with 48 additions and 0 deletions

46
mocha-tdd.md Normal file
View File

@ -0,0 +1,46 @@
---
title: Mocha.js - TDD interface
layout: default
---
### TDD
mocha.setup('tdd');
suite('something', function() {
setup(function() {
});
test('should work', function() {
});
teardown(function() {
});
});
### Async
test('should save', function(done) {
var user = new User();
user.save(function(err) {
if (err) throw err;
done();
});
});
### Chai: Expect
var expect = chai.expect;
expect(foo).to.be.a('string');
expect(foo).to.equal('bar');
expect(foo).to.have.length(3);
expect(tea).to.have.property('flavors').with.length(3);
### See also
* [Mocha BDD](mocha.html)
* [Mocha HTML](mocha-html.html)
* [Chai](chai.html)
* [Sinon](sinon.html)
* [Sinon Chai](sinon-chai.html)

View File

@ -36,6 +36,8 @@ layout: default
### See also
* [Mocha TDD](mocha.html)
* [Mocha HTML](mocha-html.html)
* [Chai](chai.html)
* [Sinon](sinon.html)
* [Sinon Chai](sinon-chai.html)