istanbul + mocha + chai 跑覆盖率的时候提示`describe is not defined`
RT,我在全局跟当前项目都安装了5.0.0版本的mocha
以及最新版本istanbul
,但是不管是跑./node_modules/.bin/istanbul cover ./test/index.test.js
还是istanbul cover ./test/index.test.js
都提示我
/Users/hubery/workspace/repos/torch/test/index.test.js:4
describe('the basic usage of Promise', function() {
^
ReferenceError: describe is not defined
at Object.<anonymous> (/Users/hubery/workspace/repos/torch/test/index.test.js:4:1)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Object.Module._extensions.(anonymous function) [as .js] (/Users/hubery/workspace/repos/torch/node_modules/istanbul/lib/hook.js:109:37)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Function.Module.runMain (module.js:676:10)
at runFn (/Users/hubery/workspace/repos/torch/node_modules/istanbul/lib/command/common/run-with-cover.js:122:16)
at /Users/hubery/workspace/repos/torch/node_modules/istanbul/lib/command/common/run-with-cover.js:251:17
请问如何解决?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论