我有一些使用helperMethod方法的文件mainFile,这是一个在文件helperFile中返回Promise的方法。如何存根从helperMethod返回的内容helperFile:module.exports.helperMethodhelperMethod);}import methodInMainFile from m
这是失败的:it('passeshost and port to the net.Socket().connect()', sinon.test(function() {
var stub = sinon.stub(net.Socket.prototypeil = new InstrumentLink(h
这是我第一次真正使用sinon,我对mocking库有一些问题。 我所要做的就是从一个名为myMethod的dao类中存根/模拟一个函数。不幸的是,我得到了错误:myMethod is not a function,这让我相信我要么把await/async关键字放在了错误的测试位置,要么我不理解sinon 100%的存根。= require("sinon");