diff --git a/types/jasmine/ts3.1/index.d.ts b/types/jasmine/ts3.1/index.d.ts index 34757496e0..96a2c9861f 100644 --- a/types/jasmine/ts3.1/index.d.ts +++ b/types/jasmine/ts3.1/index.d.ts @@ -617,9 +617,6 @@ declare namespace jasmine { type MatchableArgs = Fn extends (...args: infer P) => any ? { [K in keyof P]: P[K] | AsymmetricMatcher } : never; interface FunctionMatchers extends Matchers { - toHaveBeenCalled(): boolean; - toHaveBeenCalledBefore(expected: Func): boolean; - toHaveBeenCalledTimes(expected: number): boolean; toHaveBeenCalledWith(...params: MatchableArgs): boolean; /** diff --git a/types/jasminewd2/index.d.ts b/types/jasminewd2/index.d.ts index de136639f5..dcea91db77 100644 --- a/types/jasminewd2/index.d.ts +++ b/types/jasminewd2/index.d.ts @@ -5,7 +5,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -/// +/// declare function it(expectation: string, assertion?: (done: DoneFn) => Promise, timeout?: number): void; declare function fit(expectation: string, assertion?: (done: DoneFn) => Promise, timeout?: number): void; @@ -47,6 +47,14 @@ declare namespace jasmine { not: ArrayLikeMatchers; } + // Add definition to be compatible with latest jasmine v3 types. + // Even though library is not compatible with jasmine v3, there is no suitable way to configure that now here. + // See for more detail: https://github.com/microsoft/dtslint/issues/253 + interface FunctionMatchers any> extends Matchers { + toHaveBeenCalledWith(...params: any[]): boolean; + toHaveBeenCalledWith(...params: any[]): Promise; + } + function addMatchers(matchers: AsyncCustomMatcherFactories): void; interface Env {