No clear guidance on how to create a mock route context with body
Skwai opened this issue · comments
Cameron Jensen commented
I'm trying to write tests for a route I've created. However I cannot for the life of me figure out how to set the request.body
on createMockContext
. The request.body
is readonly so clearly it's not intended to be mutated like so:
const ctx = createMockContext()
ctx.request.body = "foo"
I've tried so search the codebase but can't see any examples or interfaces for creating a mocked JSON request context.