DEV Community

Discussion on: Testing a Generic Fetch Item List hook with Mock Service Worker

 
rexebin profile image
Rex

Thank you! I didn’t know the override, my bad, I should read the docs a lot more.

With the override, I am very happy to ditch the global error mocking. So much clearer and so elegant!

Thread Thread
 
rexebin profile image
Rex

@kettanaito Thanks to your help, I have updated @mockapi/msw removing the global error handlers. I also recommended the use of server.use to override endpoints in the readme. Phew, almost mislead the community.

Thread Thread
 
rexebin profile image
Rex

@kettanaito I also updated the tests and setup here in this post to reflect the best practices.