Skip to content

Commit

Permalink
fix #1442
Browse files Browse the repository at this point in the history
  • Loading branch information
killmenot committed Sep 3, 2017
1 parent 15d5737 commit af30213
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 af30213

Please sign in to comment.