Skip to content

Commit

Permalink
replace SetupWorkerApi with SetupWorker
Browse files Browse the repository at this point in the history
  • Loading branch information
jtoar committed Mar 1, 2023
1 parent 3291747 commit f6455a9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/testing/src/web/mockRequests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ import type {
GraphQLContext,
GraphQLRequest,
ResponseTransformer,
SetupWorkerApi,
MockedResponse,
SetupWorker,
ResponseComposition,
DefaultBodyType,
} from 'msw'

// Allow users to call "mockGraphQLQuery" and "mockGraphQLMutation"
// before the server has started. We store the request handlers in
// a queue that is drained once the server is started.
let REQUEST_HANDLER_QUEUE: RequestHandler[] = []
let SERVER_INSTANCE: SetupWorkerApi | any
let SERVER_INSTANCE: SetupWorker | any

/**
* Plugs fetch for the correct target in order to capture requests.
Expand Down Expand Up @@ -86,7 +88,7 @@ export type DataFunction<
) => Query | void

// These should get exported from MSW
type ResponseFunction<BodyType extends DefaultBodyType = any> = (
type ResponseFunction<BodyType extends DefaultBodyType> = (
...transformers: ResponseTransformer<BodyType>[]
) => MockedResponse<BodyType>

Expand Down

0 comments on commit f6455a9

Please sign in to comment.