You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Server side network request mocking with e.g. MSW is common nowadays
This works great besides that Next.js is caching the mocked requests
This idea wants to provide a solution for that problem
Non-Goals
Expose fine graded control via environment variables (too much API)
Be non-testing focused, since usually you want to have caching enabled and disable it only for integration tests
Background
We (Playwright) are exploring ways of providing mocking capabilities of server side fetch() API calls and run into an issue right now that in Next.js the caching is "too good" and its caching our mocked requests.
(The API we are playing with looks currently like this.)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Non-Goals
Background
We (Playwright) are exploring ways of providing mocking capabilities of server side fetch() API calls and run into an issue right now that in Next.js the caching is "too good" and its caching our mocked requests.
(The API we are playing with looks currently like this.)
Relates playwright-community/ssr#7
See also here more about the experiment: https://github.com/playwright-community/ssr
Proposal
Either a config option for a global
fetchCache
with the options from here or an environment, e.g. likeDISABLE_NEXTJS_FETCH_CACHE_FOR_TESTING
.Beta Was this translation helpful? Give feedback.
All reactions