Reputation: 7732
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...
Upvotes: 12
Views: 5882
Reputation: 1296
Modify your code like below:
- var stub = sinon.stub().returns(???);
+ var stub = sinon.stub().returnsArg(0);
var result = stub('foo'); //result = foo
Upvotes: 3