( input: string | Request, )
| 26 | }); |
| 27 | |
| 28 | export const dispatch = async ( |
| 29 | input: string | Request, |
| 30 | ): Promise<{ response: Response; settle: () => Promise<void> }> => { |
| 31 | const request = typeof input === 'string' ? new Request(input) : input; |
| 32 | const ctx = createExecutionContext(); |
| 33 | const response = await worker.fetch(request, testEnv, ctx); |
| 34 | |
| 35 | return { |
| 36 | response, |
| 37 | settle: async () => { |
| 38 | await waitOnExecutionContext(ctx); |
| 39 | }, |
| 40 | }; |
| 41 | }; |
| 42 | |
| 43 | export const jsonSnapshot = async (input: string | Request) => { |
| 44 | const { response, settle } = await dispatch(input); |
no test coverage detected