Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Mocha による Unit Test のテンプレ。 done() はテストの終わりを示す関数.コールバック関数内でも呼べる.
var should = require('chai').should();
describe('Hogeのテスト', function(){
describe('Hoge.method1() のテスト', function(){
it('条件1', function(done){
done();
});
it('条件2', function(done){
done();
});
});
describe('Hoge.method2() のテスト', function(){
it('条件1', function(done){
done();
});
it('条件2', function(done){
done();
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment