How to "mock" an H3 request with query string
I'm writing some unit tests for my "useValidatedQuery/useValidatedBody" functions that take a yup schema and validate the request.
I've got this working fine for the body with:
✅ this works
However I cannot get it work with the query string, I just can't work out the shape of the event, I've tried it in all the below places and none of them seem to work:
❌ none of these work
The function it gets passed into is the H3
getQuery
function:
const query = getQuery(event)
currently returning empty object1 Reply
figured it out: