Skip to content

Commit

Permalink
Merge pull request #1549 from killmenot/fix-1442
Browse files Browse the repository at this point in the history
fix #1442
  • Loading branch information
fatso83 committed Sep 12, 2017
2 parents 0a34cf5 + af30213 commit 5fbd9ee
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/sinon/mock.js
Expand Up @@ -71,6 +71,7 @@ extend(mock, {
}

var expectation = mockExpectation.create(method);
extend(expectation, this.object[method]);
push.call(this.expectations[method], expectation);

return expectation;
Expand Down
15 changes: 15 additions & 0 deletions test/issues/issues-test.js
Expand Up @@ -375,4 +375,19 @@ describe("issues", function () {
});
});
});

describe("#1442 - callThrough with a mock expectation", function () {
it("should call original method", function () {
var foo = {
bar: function () { }
};

var mock = this.sandbox.mock(foo);
mock.expects("bar").callThrough();

foo.bar();

mock.verify();
});
});
});

0 comments on commit 5fbd9ee

Please sign in to comment.