Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

mock `expects` should return an `Expectation`, rather than a `Expecta…

  • Loading branch information...
commit 426b27e929dedb71ec01cc2eff4d548815d7bbd3 1 parent 5767d78
Richard Towers authored
Showing with 10 additions and 2 deletions.
  1. +1 −1  sinon/sinon-1.5.d.ts
  2. +9 −1 sinon/sinon-tests.ts
View
2  sinon/sinon-1.5.d.ts
@@ -142,7 +142,7 @@ interface SinonExpectationStatic {
}
interface SinonMock {
- expects(method: string): SinonExpectationStatic;
+ expects(method: string): SinonExpectation;
restore(): void;
verify(): void;
}
View
10 sinon/sinon-tests.ts
@@ -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();
Please sign in to comment.
Something went wrong with that request. Please try again.