-
Notifications
You must be signed in to change notification settings - Fork 44
/
expect-extend.d.ts
80 lines (79 loc) · 1.78 KB
/
expect-extend.d.ts
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
export {}
declare global {
namespace jest {
interface Matchers<R> {
/**
* 1. Assert Yields is initially empty.
* 2. Flush all tasks.
* 3. Collect Yields and compare.
*/
toFlushAndYield(
expectedYields: any[]
): {
pass: boolean
message?: () => any
}
/**
* 1. Assert Yields is initially empty.
* 2. Flush tasks until `expectedYields.length` Yields are collected.
* 3. Compare.
*/
toFlushAndYieldThrough(
expectedYields: any[]
): {
pass: boolean
message?: () => any
}
/**
* 1. Assert Yields is initially empty.
* 2. Flush tasks until meeting a paint request.
* 3. Collect Yields and compare.
*/
toFlushUntilNextPaint(
expectedYields: any[]
): {
pass: boolean
message?: () => any
}
/**
* 1. Assert Yields is initially empty.
* 2. Flush all tasks.
* 3. Expect empty Yield.
*/
toFlushWithoutYielding(): {
pass: boolean
message?: () => any
}
/**
* 1. Assert Yields is initially empty.
* 2. Flush the next scheduled task.
* 3. Collect Yields and compare.
*/
toFlushExpired(
expectedYields: any[]
): {
pass: boolean
message?: () => any
}
/**
* Compare Yields.
*/
toHaveYielded(
expectedYields: any[]
): {
pass: boolean
message?: () => any
}
/**
* 1. Assert Yields is initially empty.
* 2. Expect exception is thrown when flushing all tasks.
*/
toFlushAndThrow(
...rest: any[]
): {
pass: boolean
message?: () => any
}
}
}
}