mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-16 12:09:24 +08:00
mock expects should return an Expectation, rather than a ExpectationStatic.
http://sinonjs.org/docs/#mocks
This commit is contained in:
2
sinon/sinon-1.5.d.ts
vendored
2
sinon/sinon-1.5.d.ts
vendored
@@ -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