-
-
Notifications
You must be signed in to change notification settings - Fork 779
Open
Labels
Description
Describe the bug
Since #2593, calling returns(...) on a stub that was previously configured with returnsArg(0) doesn't update the behavior. Instead, the original returnsArg(0) behavior is preserved.
To Reproduce
Steps to reproduce the behavior:
const stub = sandbox.stub();
stub.returnsArg(0);
console.log(stub(1));
stub.returns(42);
console.log(stub(2)); // should log 42, logs 2Context (please complete the following information):
- Sinon version : 20.0.0
- Runtime: Node 20
- Output of
npx envinfo --browsers --binaries:
N/A
- Other relevant environmental info:
- Other libraries you are using:
- Example URL:
Additional context
Add any other context about the problem here.
Reactions are currently unavailable