Skip to main content
Module

x/deno_slack_hooks/dev_deps.ts>mock

Helper library implementing the contract between the Slack CLI and Slack application SDKs
Go to Latest
variable mock
import { mock } from "https://deno.land/x/deno_slack_hooks@0.0.11/dev_deps.ts";

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));
})