|
|
1
1
从上面评论中的@Troopers链接来看,这似乎是不可能的: Doing this is not technically possible without faking the entire module loading system.
因此,我遵循了以下建议:
https://github.com/request/request/issues/2181
并使用mock require来存根
|
|
|
2
0
您可能会发现Sinon HowTo about Link Seams很有帮助: http://sinonjs.org/how-to/link-seams-commonjs/ |
|
|
Tso Liang Wu · 如何使用sinon存根oracledb? 7 年前 |
|
|
Niru · Javascript单元测试模拟高度函数 8 年前 |
|
|
Julian · mocha/sinon存根还原不工作 8 年前 |
|
|
J.R. · sinon存根未替换函数。 8 年前 |
|
|
user773737 · 存根对象而不需要方法 8 年前 |