I am trying to unit test a Deno edge function and i am a little confused by the docs. createMockContext has no option to pass a body . how do i test for POST and PUT?
import { testing } from "https://deno.land/x/oak/mod.ts";
import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
import {
getAllContacts,
getContactById,
createContact,
updateContact,
deleteContact,
} from "../_controllers/contactMeController.ts";
Deno.test({
name: 'Call createContact function',
async fn() {
const ctx = testing.createMockContext({
path: '/contact',
body???????
});
const response = await createContact(ctx);
assertEquals(ctx.response.status, 201);
},
});