Next.js Discord

Discord Forum

how to test server actions ?

Answered
Lapland Longspur posted this in #help-forum
Open in Discord
Avatar
Lapland LongspurOP
With api routes I could use postman to hit an endpoint. But with server actions what are people using ?

Because I have just scaffolded an app with no ui and am seeding a db.

I would like to know how I could test server functions with things like postman
Answered by Plague
I don't test them with outside services, Server Actions are triggered by user actions, so I test them by interacting as a user would with them in my dev server.
View full answer

4 Replies

Avatar
Lapland LongspurOP
Anyone ?
For those who are building server functions how you test them via things like postman
Avatar
I don't test them with outside services, Server Actions are triggered by user actions, so I test them by interacting as a user would with them in my dev server.
Answer
Avatar
Lapland LongspurOP
Thanks @Plague