1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | declare function it(expectation: string, assertion?: (done: DoneFn) => Promise<void>, timeout?: number): void;
|
11 | declare function fit(expectation: string, assertion?: (done: DoneFn) => Promise<void>, timeout?: number): void;
|
12 | declare function xit(expectation: string, assertion?: (done: DoneFn) => Promise<void>, timeout?: number): void;
|
13 | declare function beforeEach(action: (done: DoneFn) => Promise<void>, timeout?: number): void;
|
14 | declare function afterEach(action: (done: DoneFn) => Promise<void>, timeout?: number): void;
|
15 | declare function beforeAll(action: (done: DoneFn) => Promise<void>, timeout?: number): void;
|
16 | declare function afterAll(action: (done: DoneFn) => Promise<void>, timeout?: number): void;
|
17 |
|
18 | declare namespace jasmine {
|
19 | interface Matchers<T> {
|
20 | toBe(expected: any, expectationFailOutput?: any): Promise<void>;
|
21 | toEqual(expected: any, expectationFailOutput?: any): Promise<void>;
|
22 | toMatch(expected: string | RegExp | Promise<string | RegExp>, expectationFailOutput?: any): Promise<void>;
|
23 | toBeDefined(expectationFailOutput?: any): Promise<void>;
|
24 | toBeUndefined(expectationFailOutput?: any): Promise<void>;
|
25 | toBeNull(expectationFailOutput?: any): Promise<void>;
|
26 | toBeNaN(): Promise<void>;
|
27 | toBeTruthy(expectationFailOutput?: any): Promise<void>;
|
28 | toBeFalsy(expectationFailOutput?: any): Promise<void>;
|
29 | toHaveBeenCalled(): Promise<void>;
|
30 | toHaveBeenCalledWith(...params: any[]): Promise<void>;
|
31 | toHaveBeenCalledTimes(expected: number | Promise<number>): Promise<void>;
|
32 | toContain(expected: any, expectationFailOutput?: any): Promise<void>;
|
33 | toBeLessThan(expected: number | Promise<number>, expectationFailOutput?: any): Promise<void>;
|
34 | toBeLessThanOrEqual(expected: number | Promise<number>, expectationFailOutput?: any): Promise<void>;
|
35 | toBeGreaterThan(expected: number | Promise<number>, expectationFailOutput?: any): Promise<void>;
|
36 | toBeGreaterThanOrEqual(expected: number | Promise<number>, expectationFailOutput?: any): Promise<void>;
|
37 | toBeCloseTo(expected: number | Promise<number>, precision?: any, expectationFailOutput?: any): Promise<void>;
|
38 | toThrow(expected?: any): Promise<void>;
|
39 | toThrowError(message?: string | RegExp | Promise<string | RegExp>): Promise<void>;
|
40 | toThrowError(expected?: new (...args: any[]) => Error | Promise<new (...args: any[]) => Error>, message?: string | RegExp | Promise<string | RegExp>): Promise<void>;
|
41 | }
|
42 |
|
43 | interface ArrayLikeMatchers<T> extends Matchers<ArrayLike<T>> {
|
44 | toBe(expected: Expected<ArrayLike<T>>, expectationFailOutput?: any): Promise<void>;
|
45 | toEqual(expected: Expected<ArrayLike<T>>, expectationFailOutput?: any): Promise<void>;
|
46 | toContain(expected: T, expectationFailOutput?: any): Promise<void>;
|
47 | not: ArrayLikeMatchers<T>;
|
48 | }
|
49 |
|
50 |
|
51 |
|
52 |
|
53 | interface FunctionMatchers<Fn extends (...args: any[]) => any> extends Matchers<any> {
|
54 | toHaveBeenCalledWith(...params: any[]): boolean;
|
55 | toHaveBeenCalledWith(...params: any[]): Promise<void>;
|
56 | }
|
57 |
|
58 | function addMatchers(matchers: AsyncCustomMatcherFactories): void;
|
59 |
|
60 | interface Spec {
|
61 | addMatchers(matchers: AsyncCustomMatcherFactories): void;
|
62 | }
|
63 |
|
64 | interface AsyncCustomMatcherFactories {
|
65 | [index: string]: AsyncCustomMatcherFactory;
|
66 | }
|
67 |
|
68 | interface AsyncCustomMatcherFactory {
|
69 | (util: MatchersUtil, customEqualityTesters: CustomEqualityTester[]): AsyncCustomMatcher;
|
70 | }
|
71 |
|
72 | interface AsyncCustomMatcher {
|
73 | compare<T>(actual: T, expected: T): AsyncCustomMatcherResult;
|
74 | compare(actual: any, expected: any): AsyncCustomMatcherResult;
|
75 | }
|
76 |
|
77 | interface AsyncCustomMatcherResult {
|
78 | pass: boolean | Promise<boolean>;
|
79 | message?: string | undefined;
|
80 | }
|
81 | }
|