在调研了几个库之后,我选用了 coffee-coverage 和 mocha 这个两个库。"devDependencies": {"mocha":"^1.21.5","chai":"^1.9.2","coffee-coverage":"^0.4.2"}在test/support/env.coffee引入 coffee-coverage:ifprocess.env.COV_TEST=='true'require('coffee-coverage').registerpath:'relative'basePath:"#{__dirname}/../.."exclude: ['test','node_modules','.git','sample','static']
initAll: truecoffee-coverage 的文档上写的 exlude 示例是exclude: ['/test', '/node_modules', '/.git'], 但我在被坑了一个半小时之后才发现前面不能加斜杠…..我发了个Pull Request, 目前还没被处理。在test/app.coffee里写第一个测试,describe'app',->it'should can startup',-># 在我的机器上启动需要差不多 15 秒时间.....@timeout20000require'../
...
继续阅读
(19)