Remove Spy properties, which are no longer available

This commit is contained in:
Yaroslav Admin
2018-12-13 15:11:29 +01:00
parent ad5afdf536
commit 2c25bd5217
4 changed files with 18 additions and 6 deletions
+3 -3
View File
@@ -8,6 +8,7 @@
// Boris Breuer <https://github.com/Engineer2B>
// Chris Yungmann <https://github.com/cyungmann>
// Giles Roadnight <https://github.com/Roaders>
// Yaroslav Admin <https://github.com/devoto13>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
// For ddescribe / iit use : https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/karma-jasmine/karma-jasmine.d.ts
@@ -634,11 +635,8 @@ declare namespace jasmine {
interface Spy {
(...params: any[]): any;
identity: string;
and: SpyAnd;
calls: Calls;
mostRecentCall: { args: any[]; };
argsForCall: any[];
withArgs(...args: any[]): Spy;
}
@@ -647,6 +645,8 @@ declare namespace jasmine {
}
interface SpyAnd {
identity: string;
/** By chaining the spy with and.callThrough, the spy will still track all calls to it but in addition it will delegate to the actual implementation. */
callThrough(): Spy;
/** By chaining the spy with and.returnValue, all calls to the function will return a specific value. */
+6
View File
@@ -335,6 +335,12 @@ describe("A spy", () => {
it("stops all execution on a function", () => {
expect(bar).toBeNull();
});
it("tracks if it was called at all", function () {
foo.setBar();
expect(foo.setBar.calls.any()).toEqual(true);
});
});
describe("A spy, when configured to call through", () => {
+3 -3
View File
@@ -7,6 +7,7 @@
// Lukas Zech <https://github.com/lukas-zech-software>
// Boris Breuer <https://github.com/Engineer2B>
// Chris Yungmann <https://github.com/cyungmann>
// Yaroslav Admin <https://github.com/devoto13>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
// For ddescribe / iit use : https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/karma-jasmine/karma-jasmine.d.ts
@@ -623,11 +624,8 @@ declare namespace jasmine {
interface Spy {
(...params: any[]): any;
identity: string;
and: SpyAnd;
calls: Calls;
mostRecentCall: { args: any[]; };
argsForCall: any[];
}
type SpyObj<T> = T & {
@@ -635,6 +633,8 @@ declare namespace jasmine {
}
interface SpyAnd {
identity: string;
/** By chaining the spy with and.callThrough, the spy will still track all calls to it but in addition it will delegate to the actual implementation. */
callThrough(): Spy;
/** By chaining the spy with and.returnValue, all calls to the function will return a specific value. */
+6
View File
@@ -311,6 +311,12 @@ describe("A spy", () => {
it("stops all execution on a function", () => {
expect(bar).toBeNull();
});
it("tracks if it was called at all", function () {
foo.setBar();
expect(foo.setBar.calls.any()).toEqual(true);
});
});
describe("A spy, when configured to call through", () => {