Skip to main content
Module

x/dectyl/mod.ts>testing.jsonResponse

Prototype library for testing Deno Deploy scripts using the Deno CLI
Go to Latest
function testing.jsonResponse
import { testing } from "https://deno.land/x/dectyl@0.10.5/mod.ts";
const { jsonResponse } = testing;

A helper function that creates a tuple with the information to create a Response object.

This will throw if the object cannot be parsed to JSON or if the init, if supplied, does not contain a simple record object for the headers.

Parameters

body: unknown

The object to parse into a JSON string

optional
init: ResponseInit = [UNSUPPORTED]

Optional ResponseInit