Skip to main content
Module

x/reno/reno/testing.ts>assertResponsesAreEqual

A thin, testable routing library designed to sit on top of Deno's standard HTTP module
Latest
function assertResponsesAreEqual
import { assertResponsesAreEqual } from "https://deno.land/x/reno@v2.0.105/reno/testing.ts";

A unit testing utility to assert that actual and expected are deeply equal. The benefit of using this function over assertEquals directly is that it will convert ReadableStream bodies to strings, making them human-readable and thus helping to debug assertion failures:

const response = await ronSwansonQuoteHandler(req);

await assertResponsesAreEqual(
  response,
  jsonResponse(quotes, {
    "X-Foo": "bar",
  }),
);

Returns

Promise<void>