Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/dectyl/mod.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/mod.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]>