Lesson-13 Node 测试
2015-08-18 本文已影响58人
阿瑟李
BDD 的几个概念 describe 中的字符串,用来描述你要测的主体是什么;it
当中,描述具体的 case 内容, context 表示环境
看到了朴灵大神的一个PPT,感觉的写的虽不深入 但是好在全面 所以这里就直接照搬了
首先测试框架使用 Mocha 这是一个简单易用的库
下面是 Mocha 推荐的几个断言库
should.js BDD style shown throughout these docs
expect.js expect() style assertions
chai expect(), assert() and should style assertions
better-assert c-style self-documenting assert()