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

x/dectyl/lib/testing.ts>jsonResponse

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

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