摩卡单位testing返回0作为未捕获的exception退出代码
我有我的当前应用程序的testing套件。
有时我会引入一个错误,并导致一个未被捕获的exception被抛出。
手动运行unit testing时,可以看到错误。 但是,当我将它与我们的CI系统集成时,该过程仍然返回0,就好像一切正常。
由于这个正面的退出码,我们无法检测到错误。 我究竟做错了什么?
我终于修复了这个问题,感谢nodeJS域名:
这是我的testing/ server.coffee,在那里我设置了testing:
d = require("domain").create() # set up error handling to exit with error code on uncaught exceptions d.on "error", (err) -> console.log "Uncaught Exception:", err.message console.log err.stack process.exit(1) before (done) -> d.run -> # bootstrap application done()
这捕获所有的错误,打印跟踪和退出状态1退出。
- 使用Appium,Seleniumnetworking驱动程序,Node js,Mocha等select不在原生android应用程序的屏幕上的UI元素
- NodeJs,摩卡和mongoose
- 模拟一个HEAD请求redirect(通过nock模块)
- 如何debugging与Mocha运行的Eclipse中的Javascriptunit testing?
- 在Mocha中使用EJStesting渲染视图
- 在节点中运行时,使摩卡“使用严格”
- 从callback中返回一个值,或者在node.js中的特定callback之外访问它?
- 摩卡作为一个图书馆
- Nodejs摩卡unit testingsqlite3callback未调用插入未执行