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
Usecase:
I want to test server endpoints but for that I need to do some database queries. Within my application I use Drizzle for that which I wrapped in a util. I would like to reuse exactly this utils and possibly other composables.
Additional information
Would you be willing to help implement this feature?
Currently only the client-side half of Nuxt is available within unit testing environment, which does include your composables in ~/composables and ~/utils. For support of server composables or server environment (such as database access), we can track in #531.
I note that you are using e2e tests - nothing in your Nuxt environment is exposed in an e2e environment. You would need to directly fetch from an api endpoint. You can run code within your app that tests for if (import.meta.test) if you want to run something conditionally only in a test env (it will be tree-shaken out when building).
Thanks for your answers! I am getting "somewhere" testing my server routes, if there wouldnt be this bug: #795 - So I am kinda working blind + every time I need to wait 15s for the next result.
Describe the feature
Within tests utils and composables (especially from the server folder) should be available, currently they are not:
https://stackblitz.com/edit/github-krtpdn-tvzxcc?file=test%2Fsomething.spec.ts
Usecase:
I want to test server endpoints but for that I need to do some database queries. Within my application I use Drizzle for that which I wrapped in a util. I would like to reuse exactly this utils and possibly other composables.
Additional information
Final checks
The text was updated successfully, but these errors were encountered: