MCPcopy Create free account
hub / github.com/fontsource/fontsource / dispatch

Function dispatch

api/tests/helpers.ts:28–41  ·  view source on GitHub ↗
(
	input: string | Request,
)

Source from the content-addressed store, hash-verified

26});
27
28export 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
43export const jsonSnapshot = async (input: string | Request) => {
44 const { response, settle } = await dispatch(input);

Callers 8

metadata.test.tsFile · 0.90
open-graph.test.tsFile · 0.90
registry.test.tsFile · 0.90
cdn.test.tsFile · 0.90
stats.test.tsFile · 0.90
errors.test.tsFile · 0.90
jsonSnapshotFunction · 0.85
textSnapshotFunction · 0.85

Calls 1

fetchMethod · 0.65

Tested by

no test coverage detected