Replies: 2 comments 1 reply
-
To test API Routes you can use testing suite that allows to make fetch requests. Personally I just use Postman because it allows me to easily set headers, group the tests, inspect the results and run them together (and with a simple switch change targets from localhost to a remote server) |
Beta Was this translation helpful? Give feedback.
-
Here's an example repo using Playwright that tests an endpoint: You can run the tests with More example tests available in this very repository! https://github.com/sveltejs/kit/blob/master/packages/kit/test/apps/basics/test/server.test.js |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I have a bunch of api routes (ex:
/routes/api/endpoint/+server.ts
) and I cant find a way to test that.Is there a recommanded / documented way to do that. I don't find litterature about that.
Do you have some tips to share ?
thanks
ps : It would be awesome that testing is also present in documentation.
Beta Was this translation helpful? Give feedback.
All reactions