mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
Fix jasminewd2 compatibility with older jasmine versions (#38737)
This commit is contained in:
3
types/jasmine/ts3.1/index.d.ts
vendored
3
types/jasmine/ts3.1/index.d.ts
vendored
@@ -617,9 +617,6 @@ declare namespace jasmine {
|
||||
type MatchableArgs<Fn> = Fn extends (...args: infer P) => any ? { [K in keyof P]: P[K] | AsymmetricMatcher<any> } : never;
|
||||
|
||||
interface FunctionMatchers<Fn extends Func> extends Matchers<any> {
|
||||
toHaveBeenCalled(): boolean;
|
||||
toHaveBeenCalledBefore(expected: Func): boolean;
|
||||
toHaveBeenCalledTimes(expected: number): boolean;
|
||||
toHaveBeenCalledWith(...params: MatchableArgs<Fn>): boolean;
|
||||
|
||||
/**
|
||||
|
||||
10
types/jasminewd2/index.d.ts
vendored
10
types/jasminewd2/index.d.ts
vendored
@@ -5,7 +5,7 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
/// <reference types="jasmine/v2" />
|
||||
/// <reference types="jasmine" />
|
||||
|
||||
declare function it(expectation: string, assertion?: (done: DoneFn) => Promise<void>, timeout?: number): void;
|
||||
declare function fit(expectation: string, assertion?: (done: DoneFn) => Promise<void>, timeout?: number): void;
|
||||
@@ -47,6 +47,14 @@ declare namespace jasmine {
|
||||
not: ArrayLikeMatchers<T>;
|
||||
}
|
||||
|
||||
// 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<Fn extends (...args: any[]) => any> extends Matchers<any> {
|
||||
toHaveBeenCalledWith(...params: any[]): boolean;
|
||||
toHaveBeenCalledWith(...params: any[]): Promise<void>;
|
||||
}
|
||||
|
||||
function addMatchers(matchers: AsyncCustomMatcherFactories): void;
|
||||
|
||||
interface Env {
|
||||
|
||||
Reference in New Issue
Block a user