mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #31360 from devoto13/remove-missing-spy-methods
[jasmine] Remove Spy properties, which are no longer available
This commit is contained in:
Vendored
+3
-3
@@ -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
|
||||
@@ -637,11 +638,8 @@ declare namespace jasmine {
|
||||
interface Spy {
|
||||
(...params: any[]): any;
|
||||
|
||||
identity: string;
|
||||
and: SpyAnd;
|
||||
calls: Calls;
|
||||
mostRecentCall: { args: any[]; };
|
||||
argsForCall: any[];
|
||||
withArgs(...args: any[]): Spy;
|
||||
}
|
||||
|
||||
@@ -650,6 +648,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. */
|
||||
|
||||
@@ -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", () => {
|
||||
|
||||
Vendored
+3
-3
@@ -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. */
|
||||
|
||||
@@ -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", () => {
|
||||
|
||||
Reference in New Issue
Block a user