Next.js Discord

Discord Forum

Component tests with server actions?

Unanswered
Cape lion posted this in #help-forum
Open in Discord
Cape lionOP
Is there an approach available today which allows you to perform component tests that trigger server actions? It appears that nextjs is using a vendored version of React which makes it difficult to replicate the environment in e.g. Vitest with JSDOM. E2E tests work with something like Playwright but often you want component tests along side those. Is there an approach that works today?

0 Replies