-
I noticed the trick used in #772 for using MSW with supertest, so with v2 I tried doing: const server = setupServer(
http.all('http://127.0.0.1:*', () => passthrough()),
) What I expected to have happened is for my already passing tests to continue passsing, and to get rid of a bunch of MSW warnings for requests to endpoints that were not intercepted that I was getting, but instead what happpens is that my test suite gets broken, it fails to even get past There's some Firebase auth going on there, and I can't share my tests yet, but I expected this trick to make the requests do exactly what they were doing before, but without the MSW warning. Did I misunderstood the use case? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
What went wrong is that If I just remove the colon, then MSW warnings for superagent requests to const server = setupServer(
// removed colon after the hostname
http.all('http://127.0.0.1*', () => passthrough()),
) |
Beta Was this translation helpful? Give feedback.
What went wrong is that
:*
is being interpreted as a parameter, so I was gettingsuperagent double callback bug
errors.If I just remove the colon, then MSW warnings for superagent requests to
http://127.0.0.1
to random ports are properly removed.