N
Nuxtβ€’4mo ago
ssahillppatell

API testing in Nitro

I wrote a standalone backend in nitro. Now I am trying to write tests using vitest. I am able to test simple utils just fine. But when it comes to testing apis. I am stuck. I can't find a good solution. I tried using supertest but failed. If anyone has ever written api tests for nitro server. Please guide. πŸ™‚
2 Replies
magius
magiusβ€’4mo ago
look at how unjs maintainer test nitro to steal some idea https://github.com/unjs/nitro/blob/v2/test/tests.ts
GitHub
nitro/test/tests.ts at v2 Β· unjs/nitro
Next Generation Server Toolkit. Create web servers with everything you need and deploy them wherever you prefer. - unjs/nitro
ssahillppatell
ssahillppatellOPβ€’4mo ago
Hey man thanks ✨
Want results from more Discord servers?
Add your server