You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is impossible to test server API and server route implementations directly, because vitest does not auto import nitro (h3) functions like e.g. defineEventHandler().
When executing the test in the linked minimal reproduction, I receive this error:
FAIL test/server/routes/something.spec.ts [ test/server/routes/something.spec.ts ]
ReferenceError: defineEventHandler is not defined
❯ eval server/routes/something.ts:1:217
❯ eval test/server/routes/something.spec.ts:2:31
Environment
Reproduction
https://stackblitz.com/edit/github-xdspn8
Describe the bug
It is impossible to test server API and server route implementations directly, because vitest does not auto import nitro (h3) functions like e.g.
defineEventHandler()
.When executing the test in the linked minimal reproduction, I receive this error:
Additional context
server/routes/something.ts
test/routes/something.spec.ts
Logs
No response
The text was updated successfully, but these errors were encountered: