Questions tagged «proxyquire»

1
Proxyquire,rewire,SandboxedModule和Sinon:优点和缺点
在模拟Node依赖项时,我遇到了以下库: 代理查询 重新连线 沙盒模块 诗乃 它们似乎都或多或少地在做同一件事:允许您模拟require()调用(Sinon除外,它模拟了几乎所有内容)。它们似乎都需要一些相当复杂的设置,注意传递给字符串的确切语法require-在重构过程中效果不佳。 每个图书馆的优缺点是什么?我什么时候可以选择一个?每个库都擅长的示例用例是什么?在这个领域中还有哪些其他更好的产品?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.