How to test Nuxt 3 Nitro Server endpoints and middlewares (avoiding defineEventHandler not defined)
Hi, how would you test a Nuxt server api endpoint or middleware? I do struggle with
Would be very happy if anyone could look into my setup or provide me with resources so that I can get my setup to work
ReferenceError: defineEventHandler is not defined errors. defineEventHandler is a Nitro-specific runtime utility that is not available in my test environment. The way my test is currently set up, I am trying to execute the middleware file directly, but defineEventHandler is not properly mocked. How could I do that? I haven't found any working online resources for examples of testing Nuxt server routes / Nitro routes with Vitest in a Nuxt project :/ Would be very happy if anyone could look into my setup or provide me with resources so that I can get my setup to work
