mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-21 11:09:53 +08:00
mock expects should return an Expectation, rather than a ExpectationStatic.
http://sinonjs.org/docs/#mocks
This commit is contained in:
Vendored
+1
-1
@@ -142,7 +142,7 @@ interface SinonExpectationStatic {
|
||||
}
|
||||
|
||||
interface SinonMock {
|
||||
expects(method: string): SinonExpectationStatic;
|
||||
expects(method: string): SinonExpectation;
|
||||
restore(): void;
|
||||
verify(): void;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
Reference in New Issue
Block a user