@thisisagile/easy-test 15.8.4 → 15.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +379 -0
- package/dist/index.d.ts +379 -2
- package/dist/index.js +3 -19
- package/dist/index.mjs +3 -0
- package/package.json +3 -1
- package/src/matchers/Check.ts +18 -18
- package/src/matchers/HttpMatchers.ts +12 -13
- package/src/matchers/Match.ts +1 -2
- package/src/matchers/ResultMatchers.ts +3 -4
- package/src/matchers/toBeArrayOf.ts +1 -2
- package/src/matchers/toBeArrayOfWithLength.ts +1 -2
- package/src/matchers/toBeAt.ts +1 -2
- package/src/matchers/toBeExactlyAt.ts +1 -2
- package/src/matchers/toBeValid.ts +1 -2
- package/src/matchers/toFailMatcher.ts +2 -3
- package/src/matchers/toMatchExactJson.ts +1 -2
- package/src/matchers/toMatchException.ts +1 -2
- package/src/matchers/toMatchJson.ts +1 -2
- package/src/matchers/toMatchRoute.ts +1 -2
- package/src/matchers/toMatchText.ts +1 -2
- package/src/matchers/toPassMatcher.ts +3 -3
- package/src/mock/Mocks.ts +12 -16
- package/src/utils/Req.ts +9 -4
- package/dist/index.js.map +0 -1
- package/dist/matchers/Check.d.ts +0 -18
- package/dist/matchers/Check.js +0 -46
- package/dist/matchers/Check.js.map +0 -1
- package/dist/matchers/HttpMatchers.d.ts +0 -33
- package/dist/matchers/HttpMatchers.js +0 -52
- package/dist/matchers/HttpMatchers.js.map +0 -1
- package/dist/matchers/Match.d.ts +0 -13
- package/dist/matchers/Match.js +0 -36
- package/dist/matchers/Match.js.map +0 -1
- package/dist/matchers/ResultMatchers.d.ts +0 -15
- package/dist/matchers/ResultMatchers.js +0 -30
- package/dist/matchers/ResultMatchers.js.map +0 -1
- package/dist/matchers/index.d.ts +0 -19
- package/dist/matchers/index.js +0 -36
- package/dist/matchers/index.js.map +0 -1
- package/dist/matchers/toBeArrayOf.d.ts +0 -11
- package/dist/matchers/toBeArrayOf.js +0 -14
- package/dist/matchers/toBeArrayOf.js.map +0 -1
- package/dist/matchers/toBeArrayOfWithLength.d.ts +0 -11
- package/dist/matchers/toBeArrayOfWithLength.js +0 -15
- package/dist/matchers/toBeArrayOfWithLength.js.map +0 -1
- package/dist/matchers/toBeAt.d.ts +0 -11
- package/dist/matchers/toBeAt.js +0 -19
- package/dist/matchers/toBeAt.js.map +0 -1
- package/dist/matchers/toBeExactlyAt.d.ts +0 -11
- package/dist/matchers/toBeExactlyAt.js +0 -22
- package/dist/matchers/toBeExactlyAt.js.map +0 -1
- package/dist/matchers/toBeQueriedWith.d.ts +0 -9
- package/dist/matchers/toBeQueriedWith.js +0 -14
- package/dist/matchers/toBeQueriedWith.js.map +0 -1
- package/dist/matchers/toBeRoutedTo.d.ts +0 -9
- package/dist/matchers/toBeRoutedTo.js +0 -15
- package/dist/matchers/toBeRoutedTo.js.map +0 -1
- package/dist/matchers/toBeValid.d.ts +0 -10
- package/dist/matchers/toBeValid.js +0 -15
- package/dist/matchers/toBeValid.js.map +0 -1
- package/dist/matchers/toFailMatcher.d.ts +0 -21
- package/dist/matchers/toFailMatcher.js +0 -27
- package/dist/matchers/toFailMatcher.js.map +0 -1
- package/dist/matchers/toMatchArray.d.ts +0 -9
- package/dist/matchers/toMatchArray.js +0 -15
- package/dist/matchers/toMatchArray.js.map +0 -1
- package/dist/matchers/toMatchExactJson.d.ts +0 -16
- package/dist/matchers/toMatchExactJson.js +0 -21
- package/dist/matchers/toMatchExactJson.js.map +0 -1
- package/dist/matchers/toMatchException.d.ts +0 -11
- package/dist/matchers/toMatchException.js +0 -16
- package/dist/matchers/toMatchException.js.map +0 -1
- package/dist/matchers/toMatchJson.d.ts +0 -16
- package/dist/matchers/toMatchJson.js +0 -22
- package/dist/matchers/toMatchJson.js.map +0 -1
- package/dist/matchers/toMatchRoute.d.ts +0 -11
- package/dist/matchers/toMatchRoute.js +0 -15
- package/dist/matchers/toMatchRoute.js.map +0 -1
- package/dist/matchers/toMatchText.d.ts +0 -10
- package/dist/matchers/toMatchText.js +0 -15
- package/dist/matchers/toMatchText.js.map +0 -1
- package/dist/matchers/toPassMatcher.d.ts +0 -21
- package/dist/matchers/toPassMatcher.js +0 -27
- package/dist/matchers/toPassMatcher.js.map +0 -1
- package/dist/mock/Fits.d.ts +0 -24
- package/dist/mock/Fits.js +0 -44
- package/dist/mock/Fits.js.map +0 -1
- package/dist/mock/Mocks.d.ts +0 -41
- package/dist/mock/Mocks.js +0 -75
- package/dist/mock/Mocks.js.map +0 -1
- package/dist/mock/index.d.ts +0 -2
- package/dist/mock/index.js +0 -19
- package/dist/mock/index.js.map +0 -1
- package/dist/utils/Eq.d.ts +0 -5
- package/dist/utils/Eq.js +0 -11
- package/dist/utils/Eq.js.map +0 -1
- package/dist/utils/Req.d.ts +0 -14
- package/dist/utils/Req.js +0 -32
- package/dist/utils/Req.js.map +0 -1
- package/dist/utils/Response.d.ts +0 -25
- package/dist/utils/Response.js +0 -3
- package/dist/utils/Response.js.map +0 -1
- package/dist/utils/Types.d.ts +0 -44
- package/dist/utils/Types.js +0 -7
- package/dist/utils/Types.js.map +0 -1
- package/dist/utils/Utils.d.ts +0 -12
- package/dist/utils/Utils.js +0 -28
- package/dist/utils/Utils.js.map +0 -1
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
import { AsymmetricMatcher } from 'expect';
|
|
2
|
+
|
|
3
|
+
type OneOrMore<T> = T | Array<T>;
|
|
4
|
+
type Constructor<T> = {
|
|
5
|
+
new (...args: any[]): T;
|
|
6
|
+
};
|
|
7
|
+
type Message<P> = Text | ((...params: P[]) => Text);
|
|
8
|
+
type Validatable = {
|
|
9
|
+
isValid: boolean;
|
|
10
|
+
};
|
|
11
|
+
type Result = {
|
|
12
|
+
domain?: string;
|
|
13
|
+
location?: string;
|
|
14
|
+
message: string;
|
|
15
|
+
};
|
|
16
|
+
type Results = Validatable & {
|
|
17
|
+
results: Result[];
|
|
18
|
+
};
|
|
19
|
+
type Uri = Text;
|
|
20
|
+
type Id = string | number;
|
|
21
|
+
type JsonValue = string | number | boolean | null | Json | JsonValue[];
|
|
22
|
+
type Json = {
|
|
23
|
+
[key: string]: JsonValue;
|
|
24
|
+
};
|
|
25
|
+
type Exception = {
|
|
26
|
+
id: Id;
|
|
27
|
+
reason?: string;
|
|
28
|
+
};
|
|
29
|
+
type Text = {
|
|
30
|
+
toString: () => string;
|
|
31
|
+
};
|
|
32
|
+
type Query = Text;
|
|
33
|
+
type UseCase = {
|
|
34
|
+
app: {
|
|
35
|
+
id: Text;
|
|
36
|
+
};
|
|
37
|
+
id: Text;
|
|
38
|
+
};
|
|
39
|
+
type Tester = {
|
|
40
|
+
url: string;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
type HttpStatus = {
|
|
44
|
+
name: string;
|
|
45
|
+
id: Id;
|
|
46
|
+
};
|
|
47
|
+
type RestResult = {
|
|
48
|
+
data?: {
|
|
49
|
+
code: number;
|
|
50
|
+
items: unknown[];
|
|
51
|
+
itemCount: number;
|
|
52
|
+
};
|
|
53
|
+
error?: {
|
|
54
|
+
code: number;
|
|
55
|
+
message: string;
|
|
56
|
+
errorCount: number;
|
|
57
|
+
errors: unknown[];
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
type Response = {
|
|
61
|
+
status: HttpStatus;
|
|
62
|
+
headers?: {
|
|
63
|
+
[key: string]: any;
|
|
64
|
+
};
|
|
65
|
+
body?: RestResult;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
declare const toHaveStatus: (res: Response, code: number) => jest.CustomMatcherResult;
|
|
69
|
+
declare const toBeOk: (res: Response) => jest.CustomMatcherResult;
|
|
70
|
+
declare const toBeCreated: (res: Response) => jest.CustomMatcherResult;
|
|
71
|
+
declare const toHaveNoContent: (res: Response) => jest.CustomMatcherResult;
|
|
72
|
+
declare const toBeBadRequest: (res: Response) => jest.CustomMatcherResult;
|
|
73
|
+
declare const toBeUnauthorized: (res: Response) => jest.CustomMatcherResult;
|
|
74
|
+
declare const toBeForbidden: (res: Response) => jest.CustomMatcherResult;
|
|
75
|
+
declare const toBeNotFound: (res: Response) => jest.CustomMatcherResult;
|
|
76
|
+
declare const toBeConflict: (res: Response) => jest.CustomMatcherResult;
|
|
77
|
+
declare const toBeInternalServerError: (res: Response) => jest.CustomMatcherResult;
|
|
78
|
+
declare const toBeBadGateway: (res: Response) => jest.CustomMatcherResult;
|
|
79
|
+
declare const toBeOkWithItems: (res: Response, length: number) => jest.CustomMatcherResult;
|
|
80
|
+
declare global {
|
|
81
|
+
namespace jest {
|
|
82
|
+
interface Matchers<R, T> {
|
|
83
|
+
toBeOk(): R;
|
|
84
|
+
toBeOkWithItems(length: number): R;
|
|
85
|
+
toBeCreated(): R;
|
|
86
|
+
toHaveNoContent(): R;
|
|
87
|
+
toBeNotFound(): R;
|
|
88
|
+
toBeUnauthorized(): R;
|
|
89
|
+
toBeForbidden(): R;
|
|
90
|
+
toBeBadRequest(): R;
|
|
91
|
+
toBeConflict(): R;
|
|
92
|
+
toBeInternalServerError(): R;
|
|
93
|
+
toBeBadGateway(): R;
|
|
94
|
+
toHaveStatus(code: number): R;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
declare class Match<S> {
|
|
100
|
+
private readonly subject;
|
|
101
|
+
private readonly failed;
|
|
102
|
+
private readonly message;
|
|
103
|
+
constructor(subject: S, failed?: boolean, message?: Message<S>);
|
|
104
|
+
not(p: (s: S) => boolean, message: Message<S>): Match<S>;
|
|
105
|
+
undefined(p: (s: S) => any, message: Message<S>): Match<S>;
|
|
106
|
+
else(message: Message<S>): jest.CustomMatcherResult;
|
|
107
|
+
}
|
|
108
|
+
declare const match: <S>(subject: S) => Match<S>;
|
|
109
|
+
|
|
110
|
+
type ToMessage<S> = string | ((s: S[]) => string);
|
|
111
|
+
declare class Check<S> {
|
|
112
|
+
private ctx;
|
|
113
|
+
private readonly received;
|
|
114
|
+
private readonly expected;
|
|
115
|
+
private readonly failed;
|
|
116
|
+
private readonly message;
|
|
117
|
+
constructor(ctx: jest.MatcherContext, received: S, expected: S, failed?: boolean, message?: string);
|
|
118
|
+
print(message: ToMessage<S>): string;
|
|
119
|
+
not(p: (s: S[]) => boolean, message: ToMessage<S>): Check<S>;
|
|
120
|
+
undefined(p: (s: S[]) => any, message: ToMessage<S>): Check<S>;
|
|
121
|
+
else(message?: ToMessage<S>): jest.CustomMatcherResult;
|
|
122
|
+
}
|
|
123
|
+
declare const check: <S>(ctx: jest.MatcherContext, received: S, expected?: S | undefined) => Check<S>;
|
|
124
|
+
declare const checkDefined: <S>(ctx: jest.MatcherContext, received: S, expected?: S | undefined) => Check<S>;
|
|
125
|
+
|
|
126
|
+
declare const toResultWith: (results: Results, message: string) => jest.CustomMatcherResult;
|
|
127
|
+
declare const toFail: (results: Results) => jest.CustomMatcherResult;
|
|
128
|
+
declare const toFailWith: (results: Results, message: string) => jest.CustomMatcherResult;
|
|
129
|
+
declare global {
|
|
130
|
+
namespace jest {
|
|
131
|
+
interface Matchers<R, T> {
|
|
132
|
+
toResultWith(message: string): R;
|
|
133
|
+
toFail(): R;
|
|
134
|
+
toFailWith(message: string): R;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
declare const toBeArrayOf: <T>(items: unknown, ctor: Constructor<T>) => jest.CustomMatcherResult;
|
|
140
|
+
declare global {
|
|
141
|
+
namespace jest {
|
|
142
|
+
interface Matchers<R, T> {
|
|
143
|
+
toBeArrayOf<Z>(ctor: Constructor<Z>): R;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
declare const toBeArrayOfWithLength: <T>(items: unknown, ctor: Constructor<T>, length: number) => jest.CustomMatcherResult;
|
|
149
|
+
declare global {
|
|
150
|
+
namespace jest {
|
|
151
|
+
interface Matchers<R, T> {
|
|
152
|
+
toBeArrayOfWithLength<Z>(ctor: Constructor<Z>, length: number): R;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
declare const toBeAt: (tester?: Tester, uc?: UseCase, id?: Id) => jest.CustomMatcherResult;
|
|
158
|
+
declare global {
|
|
159
|
+
namespace jest {
|
|
160
|
+
interface Matchers<R, T> {
|
|
161
|
+
toBeAt(uc?: UseCase, id?: Id): R;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
declare const toBeExactlyAt: (tester?: Tester, uc?: UseCase, id?: Id) => jest.CustomMatcherResult;
|
|
167
|
+
declare global {
|
|
168
|
+
namespace jest {
|
|
169
|
+
interface Matchers<R, T> {
|
|
170
|
+
toBeExactlyAt(uc?: UseCase, id?: Id): R;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
declare const Fails: {
|
|
176
|
+
Yes: string;
|
|
177
|
+
No: (reason: string) => string;
|
|
178
|
+
};
|
|
179
|
+
declare const FailsWith: {
|
|
180
|
+
Yes: string;
|
|
181
|
+
No: (message: string, instead: string) => string;
|
|
182
|
+
};
|
|
183
|
+
declare const toFailMatcher: (result: jest.CustomMatcherResult) => jest.CustomMatcherResult;
|
|
184
|
+
declare const toFailMatcherWith: (result: jest.CustomMatcherResult, message: Message<jest.CustomMatcherResult>) => jest.CustomMatcherResult;
|
|
185
|
+
declare global {
|
|
186
|
+
namespace jest {
|
|
187
|
+
interface Matchers<R, T> {
|
|
188
|
+
toFailMatcher(): R;
|
|
189
|
+
toFailMatcherWith(message: string): R;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
declare const toBeValid: (v?: unknown) => jest.CustomMatcherResult;
|
|
195
|
+
declare global {
|
|
196
|
+
namespace jest {
|
|
197
|
+
interface Matchers<R, T> {
|
|
198
|
+
toBeValid(): R;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
declare function toMatchArray(this: jest.MatcherContext, received: any[], expected: any[]): jest.CustomMatcherResult;
|
|
204
|
+
declare global {
|
|
205
|
+
namespace jest {
|
|
206
|
+
interface Matchers<R, T> {
|
|
207
|
+
toMatchArray(expected: any[]): R;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
declare const MatchesExactJson: {
|
|
213
|
+
SubjectUndefined: string;
|
|
214
|
+
SubsetUndefined: string;
|
|
215
|
+
DoesNotMatch: string;
|
|
216
|
+
Yes: string;
|
|
217
|
+
};
|
|
218
|
+
declare const toMatchExactJson: (value?: unknown, json?: unknown) => jest.CustomMatcherResult;
|
|
219
|
+
declare global {
|
|
220
|
+
namespace jest {
|
|
221
|
+
interface Matchers<R, T> {
|
|
222
|
+
toMatchExactJson(json?: unknown): R;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
declare const toMatchException: (received: Exception, expected: unknown, reason?: string) => jest.CustomMatcherResult;
|
|
228
|
+
declare global {
|
|
229
|
+
namespace jest {
|
|
230
|
+
interface Matchers<R, T> {
|
|
231
|
+
toMatchException(exception: unknown, reason?: string): R;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
declare const MatchesJson: {
|
|
237
|
+
SubjectUndefined: string;
|
|
238
|
+
SubsetUndefined: string;
|
|
239
|
+
DoesNotMatch: string;
|
|
240
|
+
Yes: string;
|
|
241
|
+
};
|
|
242
|
+
declare const toMatchJson: (value?: unknown, subset?: unknown) => jest.CustomMatcherResult;
|
|
243
|
+
declare global {
|
|
244
|
+
namespace jest {
|
|
245
|
+
interface Matchers<R, T> {
|
|
246
|
+
toMatchJson(subset?: unknown): R;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
declare const toMatchRoute: (uri?: Uri, route?: Uri | string) => jest.CustomMatcherResult;
|
|
252
|
+
declare global {
|
|
253
|
+
namespace jest {
|
|
254
|
+
interface Matchers<R, T> {
|
|
255
|
+
toMatchRoute(route?: Uri | string): R;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
declare const toMatchText: (value?: unknown, text?: unknown) => jest.CustomMatcherResult;
|
|
261
|
+
declare global {
|
|
262
|
+
namespace jest {
|
|
263
|
+
interface Matchers<R, T> {
|
|
264
|
+
toMatchText(text?: unknown): R;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
declare const Passes: {
|
|
270
|
+
Yes: string;
|
|
271
|
+
No: (reason: string) => string;
|
|
272
|
+
};
|
|
273
|
+
declare const PassesWith: {
|
|
274
|
+
Yes: string;
|
|
275
|
+
No: (message: string, instead: string) => string;
|
|
276
|
+
};
|
|
277
|
+
declare const toPassMatcher: (result: jest.CustomMatcherResult) => jest.CustomMatcherResult;
|
|
278
|
+
declare const toPassMatcherWith: (result: jest.CustomMatcherResult, message: Message<jest.CustomMatcherResult>) => jest.CustomMatcherResult;
|
|
279
|
+
declare global {
|
|
280
|
+
namespace jest {
|
|
281
|
+
interface Matchers<R, T> {
|
|
282
|
+
toPassMatcher(): R;
|
|
283
|
+
toPassMatcherWith(message: string): R;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
declare const toBeQueriedWith: (query: jest.Mock, expected: Query) => jest.CustomMatcherResult;
|
|
289
|
+
declare global {
|
|
290
|
+
namespace jest {
|
|
291
|
+
interface Matchers<R, T> {
|
|
292
|
+
toBeQueriedWith(expected: Query): R;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
declare const toBeRoutedTo: (query: jest.Mock, expected: Uri) => jest.CustomMatcherResult;
|
|
298
|
+
declare global {
|
|
299
|
+
namespace jest {
|
|
300
|
+
interface Matchers<R, T> {
|
|
301
|
+
toBeRoutedTo(uri: Uri): R;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
declare class ObjectContainingText extends AsymmetricMatcher<string> {
|
|
307
|
+
asymmetricMatch(other: any): boolean;
|
|
308
|
+
toString(): string;
|
|
309
|
+
}
|
|
310
|
+
declare class ObjectContainingTextExact extends AsymmetricMatcher<string> {
|
|
311
|
+
asymmetricMatch(other: any): boolean;
|
|
312
|
+
toString(): string;
|
|
313
|
+
}
|
|
314
|
+
declare class ObjectContainingJson extends AsymmetricMatcher<any> {
|
|
315
|
+
asymmetricMatch(other: any): boolean;
|
|
316
|
+
toString(): string;
|
|
317
|
+
}
|
|
318
|
+
declare const fits: {
|
|
319
|
+
any: () => any;
|
|
320
|
+
type: (type?: unknown) => any;
|
|
321
|
+
with: (o: unknown) => any;
|
|
322
|
+
text: (s: any) => any;
|
|
323
|
+
textExact: (s: any) => any;
|
|
324
|
+
uri: (u: Uri) => any;
|
|
325
|
+
json: (s: any) => any;
|
|
326
|
+
items: (...items: any[]) => any;
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
declare class Req {
|
|
330
|
+
readonly state: any;
|
|
331
|
+
constructor(state?: any);
|
|
332
|
+
get id(): Id;
|
|
333
|
+
get q(): JsonValue;
|
|
334
|
+
get path(): Json;
|
|
335
|
+
get query(): Json;
|
|
336
|
+
get skip(): number | undefined;
|
|
337
|
+
get take(): number | undefined;
|
|
338
|
+
get body(): unknown;
|
|
339
|
+
get headers(): Record<string, OneOrMore<string>>;
|
|
340
|
+
get: (key: Text) => any;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
declare class Mocks {
|
|
344
|
+
clear: () => typeof jest;
|
|
345
|
+
impl: (f?: ((...args: any[]) => any) | undefined) => jest.Mock;
|
|
346
|
+
property: <T extends object, P extends keyof { [K in keyof Required<T> as Required<T>[K] extends jest.Func ? never : K]: Required<T>[K]; }>(object: T, getter: P, value: T[P]) => jest.SpyInstance;
|
|
347
|
+
reject: (value?: unknown) => jest.Mock;
|
|
348
|
+
rejectWith: <T = any>(props?: Partial<T>) => jest.Mock;
|
|
349
|
+
req: {
|
|
350
|
+
id: (id: Id) => Req;
|
|
351
|
+
q: (q: unknown) => Req;
|
|
352
|
+
with: (a: Json) => Req;
|
|
353
|
+
body: (body: unknown) => Req;
|
|
354
|
+
path: (path: Json) => Req;
|
|
355
|
+
query: (query: Json) => Req;
|
|
356
|
+
};
|
|
357
|
+
resp: {
|
|
358
|
+
items: (status: HttpStatus, items?: unknown[]) => Response;
|
|
359
|
+
errors: (status: HttpStatus, message: string, errors?: unknown[]) => Response;
|
|
360
|
+
};
|
|
361
|
+
resolve: (value?: unknown) => jest.Mock;
|
|
362
|
+
resolveWith: <T = any>(props?: Partial<T>) => jest.Mock;
|
|
363
|
+
return: (value?: unknown) => jest.Mock;
|
|
364
|
+
returnWith: <T = any>(props?: Partial<T>) => jest.Mock;
|
|
365
|
+
this: () => jest.Mock;
|
|
366
|
+
provider: {
|
|
367
|
+
data: (...items: any[]) => {
|
|
368
|
+
execute: jest.Mock;
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
empty: <T = any>(props?: Partial<T>) => T;
|
|
372
|
+
a: <T = any>(props?: Partial<T>) => T;
|
|
373
|
+
an: <T = any>(props?: Partial<T>) => T;
|
|
374
|
+
date: (epoch?: number) => Date;
|
|
375
|
+
once: (...values: unknown[]) => jest.Mock;
|
|
376
|
+
}
|
|
377
|
+
declare const mock: Mocks;
|
|
378
|
+
|
|
379
|
+
export { Fails, FailsWith, Match, MatchesExactJson, MatchesJson, Mocks, ObjectContainingJson, ObjectContainingText, ObjectContainingTextExact, Passes, PassesWith, check, checkDefined, fits, match, mock, toBeArrayOf, toBeArrayOfWithLength, toBeAt, toBeBadGateway, toBeBadRequest, toBeConflict, toBeCreated, toBeExactlyAt, toBeForbidden, toBeInternalServerError, toBeNotFound, toBeOk, toBeOkWithItems, toBeQueriedWith, toBeRoutedTo, toBeUnauthorized, toBeValid, toFail, toFailMatcher, toFailMatcherWith, toFailWith, toHaveNoContent, toHaveStatus, toMatchArray, toMatchExactJson, toMatchException, toMatchJson, toMatchRoute, toMatchText, toPassMatcher, toPassMatcherWith, toResultWith };
|