import { assertResponsesAreEqual } from "https://deno.land/x/reno@v2.0.75/reno/mod.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",
}),
);