Skip to content

Commit

Permalink
Add reflected test and fixup test titles
Browse files Browse the repository at this point in the history
  • Loading branch information
fatso83 committed Apr 25, 2024
1 parent f4fb595 commit 90f80a5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/issues/issues-test.js
Expand Up @@ -915,7 +915,7 @@ describe("issues", function () {
assert.equals(spy.get.callCount, 1); // should remain unchanged
});

it("#2572 - returns clear callArgAt", function () {
it("#2572 - returns should not clear callsArgWith", function () {
const stub = sinon.stub();
stub.callsArgWith(0, "Hello").returns("World");

Expand All @@ -926,4 +926,16 @@ describe("issues", function () {
assert(cb.calledOnce);
assert.equals(cb.firstCall.args, ["Hello"]);
});

it("#2572 - callsArgWith should not clear returns", function () {
const stub = sinon.stub();
stub.returns("World").callsArgWith(0, "Hello");

const cb = sinon.stub();
const ret = stub(cb);

assert.equals(ret, "World");
assert(cb.calledOnce);
assert.equals(cb.firstCall.args, ["Hello"]);
});
});

0 comments on commit 90f80a5

Please sign in to comment.