-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommands.d.ts
36 lines (30 loc) · 1.06 KB
/
commands.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
/// <reference types="Cypress" />
declare namespace Cypress {
type MockedResponse = import('msw').MockedResponse;
type MSWRestHandlerFunction = (
req: import('msw').RestRequest,
res: import('msw').ResponseComposition,
ctx: import('msw').RestContext
) => MockedResponse | Promise<MockedResponse>;
type MSWGraphqlHandlerFunction<DataType, Variables> = (
req: import('msw').GraphQLRequest<Variables>,
res: import('msw').ResponseComposition,
ctx: import('msw').GraphQLContext<DataType>
) => MockedResponse | Promise<MockedResponse>;
interface Chainable {
mswRestIntercept: (
type: import('./dist/types').RestMethod,
route: string,
fn?: MSWRestHandlerFunction
) => Chainable<string>;
mswGraphqlIntercept: <
DataType = Record<string, any>,
Variables = Record<string, any>
>(
operation: import('./dist/types').GraphqlOperationType,
operationName: string,
fn?: MSWGraphqlHandlerFunction<DataType, Variables>
) => Chainable<string>;
mswWait: (alias: string) => Chainable<void>;
}
}