How can I make a stub that returns it's own arguments, like so:
var stub = sinon.stub().returns(???);
var result = stub('foo'); //result = foo
This will be nested so I can't return nothing and then check stub.getCall...
How can I make a stub that returns it's own arguments, like so:
var stub = sinon.stub().returns(???);
var result = stub('foo'); //result = foo
This will be nested so I can't return nothing and then check stub.getCall...
Modify your code like below:
- var stub = sinon.stub().returns(???);
+ var stub = sinon.stub().returnsArg(0);
var result = stub('foo'); //result = foo