import { mockFetch } from "https://dotland.deno.dev/x/deno_slack_hooks@0.5.0/dev_deps.ts";
const { mock } = mockFetch;
Mock a new route, or override an existing handler.
The route uses URLPattern syntax, with the additional extension of
(optional) method routing by prefixing with the method,
eg. "POST@/user/:id"
.
The handler function may be asynchronous.
mock("GET@/users/:id", async (_req, params) => {
const id = parseInt(params["id"]);
const data = await magicallyGetMyUserData(id);
return new Response(JSON.stringify(data));
})