mock expects should return an Expectation, rather than a ExpectationStatic.

http://sinonjs.org/docs/#mocks
This commit is contained in:
Richard Towers
2013-03-25 15:05:08 +00:00
parent 5767d78ced
commit 426b27e929
2 changed files with 10 additions and 2 deletions

View File

@@ -142,7 +142,7 @@ interface SinonExpectationStatic {
}
interface SinonMock {
expects(method: string): SinonExpectationStatic;
expects(method: string): SinonExpectation;
restore(): void;
verify(): void;
}

View File

@@ -69,9 +69,17 @@ function testSix() {
stub.restore();
}
function testSeven() {
var obj = { functionToTest : function () { } };
var mockObj = sinon.mock(obj);
obj.functionToTest();
mockObj.expects('functionToTest').once();
}
testOne();
testTwo();
testThree();
testFour();
testFive();
testSix();
testSix();
testSeven();