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
Execution of visual tests on Chromatic goes from 3 minutes on average to around 18 minutes
Changing the following code:
initializeWorker({onUnhandledRequest(req){// Only some API requests should be mockedif(!req.url.href.startsWith(myapi(''))){return;}console.error('Found an unhandled %s request to %s',req.method,req.url.href,);thrownewError('Unhandled request, please ensure you are mocking the correct endpoints',);},});
to simply:
initializeWorker();
fixed the issue.
I'm not sure if the problem is with this addon, with msw itself, or with how the integration is being done. If I want to workaround this and provide a fallback request handler to setupServer, I can't because there is no way to forward options to setupServer.
Version info:
msw-storybook-addon: 1.1.0 msw: 0.30.0:
The text was updated successfully, but these errors were encountered:
I can suspect the suggestions logic in MSW that can be the culprit here. Whenever there's an unhandled request, MSW looks up a list of suggested request handlers to account for typos and method/operation kind mismatches to improve the DX. This can be an expensive operation given a large number of handlers.
Your approach above is sensible. Perhaps we should consider disabling the handler suggestions as an option if that's proven to be the performance bottleneck. To debug this, I recommend forking MSW, removing the suggestions, linking it to the msw-storybook-addon and using its local built to see if there's any performance impact.
Problem
Execution of visual tests on Chromatic goes from 3 minutes on average to around 18 minutes
Changing the following code:
to simply:
fixed the issue.
I'm not sure if the problem is with this addon, with msw itself, or with how the integration is being done. If I want to workaround this and provide a fallback request handler to setupServer, I can't because there is no way to forward options to setupServer.
Version info:
msw-storybook-addon: 1.1.0
msw: 0.30.0:
The text was updated successfully, but these errors were encountered: