-
-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathjest.d.ts
More file actions
37 lines (29 loc) · 1.44 KB
/
jest.d.ts
File metadata and controls
37 lines (29 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/// <reference types="./types/expect-webdriverio.d.ts"/>
/**
* Augment the Jest namespace to include the matchers from expect-webdriverio.
* When Jest Library is used, it specifies `expect-webdriverio/jest` for this file in the tsconfig.json's types.
*/
declare namespace jest {
interface Matchers<R extends void | Promise<void>, T> extends ExpectWebdriverIO.Matchers<R, T> {
/**
* Below are overloaded Jest's matchers not part of `expect` but of `jest-snapshot`.
* @see https://github.com/jestjs/jest/blob/73dbef5d2d3195a1e55fb254c54cce70d3036252/packages/jest-snapshot/src/types.ts#L37
*
* Note: We need to define them below so that they are correctly typed overloaded.
* Else even when extending `WdioJestOverloadedMatchers` we have typing errors.
*/
/**
* snapshot matcher
* @param label optional snapshot label
*/
toMatchSnapshot(label?: string): T extends WdioPromiseLike ? Promise<void> : void;
/**
* inline snapshot matcher
* @param snapshot snapshot string (autogenerated if not specified)
* @param label optional snapshot label
*/
toMatchInlineSnapshot(snapshot?: string, label?: string): T extends WdioPromiseLike ? Promise<void> : void;
}
interface Expect extends ExpectWebdriverIO.Expect {}
interface InverseAsymmetricMatchers extends ExpectWebdriverIO.AsymmetricMatchers {}
}