Next.js Discord

Discord Forum

Having trouble mocking in NextJS with playwright

Unanswered
Mugger Crocodile posted this in #help-forum
Open in Discord
Mugger CrocodileOP
I'm using this experimental package from Next which allows me to test my server side NextJS code using playwright: import { test } from 'next/experimental/testmode/playwright';

But sometimes, especially on my CI pipeline in gitlab, the mocking service returns a 500 Server Error. This is confusing because the playwright/Next network requests are intercepted by the mocking service so I'd expect them to always succeed with the hardcoded mocked response. About 90% of the time they do succeed, and the mocked responses that I've written make up the response body of the 200 status requests. Any thoughts on how I might fix this?

0 Replies