使用摩卡进行unit testing的电解质依赖性注入
在electrolyte.js中,我们通常会创build一个模块:emodule.js(example)
exports=module.exports=function(module1,module2,module3){ }; exports["@singleton"]=true; exports["@require"] = ["module1","module2","module3"]
现在,如果我们想在mochatesting中真正模拟module2,那么我们应该如何调用emodule.js,这样所有对module2的调用都将被redirect到模拟? 感谢任何指针…
你有没有看到像bottlejs( https://github.com/young-steveo/bottlejs )或SimpleDiJs( https://github.com/avighier/simple-dijs )其他dependency injection容器系统?
- 在NodeJS中testing与数据库相关的代码
- 在所有使用摩卡的testing之后,在哪里删除数据库并closures连接
- 在JavaScript中整合了代码覆盖率报告
- unit testing承诺不工作
- Supertest,我可以创build一个替代的请求与默认设置一些标头?
- 如何确保在节点上使用mocha和phantomjs进行每个testing的未触及的HTML
- 使用SailsJS / Node,Mocha,Supertest进行authentication的会话存储
- 摩卡APItesting:得到'TypeError:app.address不是一个函数'
- 如何debugging与Mocha运行的Eclipse中的Javascriptunit testing?