I have a file, myFunction.ts
that defines and exports one function:
export function MyFunction() {
return async (ctx: Koa.Context) => {
//some work happens in here
};
}
This function gets called in a Koa middleware file and inherits the ctx
from previous middleware. How does one create a mock ctx
to test MyFunction()
in this case?
Aucun commentaire:
Enregistrer un commentaire