Skip to content

Commit

Permalink
Add regression test for #2572
Browse files Browse the repository at this point in the history
  • Loading branch information
fatso83 committed Apr 25, 2024
1 parent ed068a8 commit 09b4da5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/issues/issues-test.js
Expand Up @@ -914,4 +914,16 @@ describe("issues", function () {
object.prop;
assert.equals(spy.get.callCount, 1); // should remain unchanged
});

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

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 09b4da5

Please sign in to comment.