Si je crée ma fonction comme suit
const sandbox: sinon.SinonSandbox = sinon.createSandbox();
getInfoStub = sandbox.stub(ytdl, 'getInfo').withArgs(videoUrl).resolves(videoInfo);
Ensuite, j'essaie de faire getInfoStub.restore() et j'obtiens une erreur de type TypeError: getInfoStub.restore is not a function
Cependant, lorsque je supprime l'option .withArgs(videoUrl)
restore
fonctionne bien :
const sandbox: sinon.SinonSandbox = sinon.createSandbox();
getInfoStub = sandbox.stub(ytdl, 'getInfo').resolves(videoInfo);
Qu'en est-il de withArgs
qui casse sinon ?