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
Hey folks, I have a few dozen handlers being used in MSW as an array and I see to overwrite it using the addon I would have to make them "named handlers" which from the setupServer() definition is not allowed. It would also require a high amount of effort to convert them into an object map.
So is there a way to overwrite the initial global handlers in the story similar to server.use(...)? So I would not have to change my handler's definition and be able to use them on Storybook and regular tests.
Thank you!
The text was updated successfully, but these errors were encountered:
Hi, @BrunoQuaresma. From my understanding of the Storybook merge algorithm, the array of request handlers you provide on the individual story level will take precedence over the base request handlers you provide to initialize(). Named handlers just allow you to disable a certain group of handlers altogether.
@yannbf, please correct me if I'm wrong here. If I am, this is likely a bug and we need to look into this. Also, will check if we have tests for this use case.
Hey folks, I have a few dozen handlers being used in MSW as an array and I see to overwrite it using the addon I would have to make them "named handlers" which from the
setupServer()
definition is not allowed. It would also require a high amount of effort to convert them into an object map.So is there a way to overwrite the initial global handlers in the story similar to
server.use(...)
? So I would not have to change my handler's definition and be able to use them on Storybook and regular tests.Thank you!
The text was updated successfully, but these errors were encountered: