Skip to content

Instantly share code, notes, and snippets.

@nkmry
Created March 5, 2014 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nkmry/fbece31a2102bfa6975c to your computer and use it in GitHub Desktop.
Save nkmry/fbece31a2102bfa6975c to your computer and use it in GitHub Desktop.
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