-
-
Notifications
You must be signed in to change notification settings - Fork 771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stub#firstCall seems broken on sinon v2.3.6 #1476
Comments
Thank you for the easy to follow regression report! With a slightly modified version of your test (below) and // test/issues/issue-1476-test.js
"use strict";
var assert = require("referee").assert;
var refute = require("referee").refute;
var sinon = require("../../lib/sinon");
describe.only("Issue #1476 - withArgs.firstCall, when stub has been called", function () {
it("must not be null", function () {
var stub = sinon.stub();
stub.withArgs("broken").returns(42);
stub("broken");
refute.equals(stub.withArgs("broken").firstCall, null);
});
}); I have yet to determine why it is failing |
@HugoMuller, could you check if the issue above is fixed by checking out #1478? |
Fix #1476: stub#firstCall seems broken on sinon v2.3.6
Hello, sorry for the delay :( |
This has been published as |
Hmm it seems with this patch (in 2.3.7) withArgs().lastCall is broken. |
Hello @jvanoostveen. |
Hello,
First of all, thanks for the work done :)
Today, one of our unit tests has failed after the update of sinon. (v2.3.5 -> v2.3.6)
We think the latest release introduced a regression.
What did you expect to happen?
I expect both stub.getCall(0) and stub.firstCall to return the same thing, even with a stub created with withArgs.
What actually happens
When I create a stub responding to particular arguments with stub.withArgs, this stub can't be inspected with firstCall.
stub.getCall(0) works fine but stub.firstCall returns null. In the previous release (v2.3.5), calling stub.getCall(0) and getting stub.firstCall produced the same result.
The same issue can be observed with secondCall and thirdCall as well.
How to reproduce
The text was updated successfully, but these errors were encountered: