@@ -21,47 +21,81 @@ export interface FetchMock
21
21
extends Mock < [ string | Request | undefined , RequestInit | undefined ] , Promise < Response > > {
22
22
( input : string | Request , init ?: RequestInit ) : Promise < Response > ;
23
23
24
- // Response mocking
24
+ /**
25
+ * Response mocking
26
+ */
25
27
mockResponse ( fn : MockResponseInitFunction ) : FetchMock ;
26
28
mockResponse ( response : string , responseInit ?: MockParams ) : FetchMock ;
27
29
30
+ /**
31
+ * Response mocking
32
+ */
28
33
mockResponseOnce ( fn : MockResponseInitFunction ) : FetchMock ;
29
34
mockResponseOnce ( response : string , responseInit ?: MockParams ) : FetchMock ;
30
35
31
- // alias for mockResponseOnce
36
+ /**
37
+ * alias for mockResponseOnce
38
+ */
32
39
once ( fn : MockResponseInitFunction ) : FetchMock ;
33
40
once ( url : string , responseInit ?: MockParams ) : FetchMock ;
34
41
42
+ /**
43
+ * Response mocking for multiple calls
44
+ */
35
45
mockResponses ( ...responses : Array < string | [ string , MockParams ] | MockResponseInitFunction > ) : FetchMock ;
36
46
37
- // Error/Reject mocking
47
+ /**
48
+ * Error/Reject mocking
49
+ */
38
50
mockReject ( error ?: ErrorOrFunction ) : FetchMock ;
51
+ /**
52
+ * Error/Reject mocking
53
+ */
39
54
mockRejectOnce ( error ?: ErrorOrFunction ) : FetchMock ;
40
-
55
+ /**
56
+ * Error/Reject mocking
57
+ */
41
58
mockAbort ( ) : FetchMock ;
59
+ /**
60
+ * Error/Reject mocking
61
+ */
42
62
mockAbortOnce ( ) : FetchMock ;
43
63
44
- // Conditional Mocking
64
+ /**
65
+ * Conditional Mocking
66
+ */
45
67
isMocking ( input : string | Request ) : boolean ;
46
68
69
+ /**
70
+ * Conditional Mocking
71
+ */
47
72
doMock ( fn ?: MockResponseInitFunction ) : FetchMock ;
48
73
doMock ( response : string , responseInit ?: MockParams ) : FetchMock ;
49
74
75
+ /**
76
+ * Conditional Mocking
77
+ */
50
78
doMockOnce ( fn ?: MockResponseInitFunction ) : FetchMock ;
51
79
doMockOnce ( response : string , responseInit ?: MockParams ) : FetchMock ;
52
- // alias for doMockOnce
80
+ /**
81
+ * alias for doMockOnce
82
+ */
53
83
mockOnce ( fn ?: MockResponseInitFunction ) : FetchMock ;
54
84
mockOnce ( response : string , responseInit ?: MockParams ) : FetchMock ;
55
85
56
86
doMockIf ( urlOrPredicate : UrlOrPredicate , fn ?: MockResponseInitFunction ) : FetchMock ;
57
87
doMockIf ( urlOrPredicate : UrlOrPredicate , response : string , responseInit ?: MockParams ) : FetchMock ;
58
- // alias for doMockIf
88
+ /**
89
+ * alias for doMockIf
90
+ */
59
91
mockIf ( urlOrPredicate : UrlOrPredicate , fn ?: MockResponseInitFunction ) : FetchMock ;
60
92
mockIf ( urlOrPredicate : UrlOrPredicate , response : string , responseInit ?: MockParams ) : FetchMock ;
61
93
62
94
doMockOnceIf ( urlOrPredicate : UrlOrPredicate , fn ?: MockResponseInitFunction ) : FetchMock ;
63
95
doMockOnceIf ( urlOrPredicate : UrlOrPredicate , response : string , responseInit ?: MockParams ) : FetchMock ;
64
- // alias for doMocKOnceIf
96
+ /**
97
+ * alias for doMocKOnceIf
98
+ */
65
99
mockOnceIf ( urlOrPredicate : UrlOrPredicate , fn ?: MockResponseInitFunction ) : FetchMock ;
66
100
mockOnceIf ( urlOrPredicate : UrlOrPredicate , response : string , responseInit ?: MockParams ) : FetchMock ;
67
101
0 commit comments