Next.js Discord

Discord Forum

Unit Test

Unanswered
Sloth bear posted this in #help-forum
Open in Discord
Sloth bearOP
the case i had, when i ran the unit test, i got the error message: To use Server Actions, please enable the feature flag in your Next.js config. Read more: https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions#convention.

I myself have previously tried enabling Server Actions, and testing the function that I created, the function's purpose is to create a User, and send it to the database.

2 Replies

Sloth bearOP
I know, that this is quite a strange action for me to do, because the router app itself doesn't provide docs for unit-testing.

so I thought, maybe this is an error, or a bug from the unit test, this is just my assumption