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()