1 | initial version |
To pass arguments through a Sinon stub, you can use the callsFake
method along with an anonymous function that takes arguments.
Example:
const myStub = sinon.stub();
myStub.callsFake((arg1, arg2) => {
// do something with arg1 and arg2
});
Then, when you call myStub
with arguments, the anonymous function will be called with those arguments.