Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/dectyl/lib/deploy_worker.ts>DeployWorker#fetch

Prototype library for testing Deno Deploy scripts using the Deno CLI
Latest
method DeployWorker.prototype.fetch
import { DeployWorker } from "https://deno.land/x/dectyl@0.10.7/lib/deploy_worker.ts";

Send a request into the program and resolve with the resulting Response and additional information about the request.

For example:

const helloWorld = await createWorker("./hello_world.ts");
await helloWorld.run(async () => {
  const [response, info] = await helloWorld.fetch("/");
  // make assertions against the response
});

Parameters

input: string | Request | URL
optional
requestInit: RequestInit
optional
remoteAddr: Deno.NetAddr = [UNSUPPORTED]

Returns

Promise<[Response, RequestResponseInfo]>