Make console.warn configurable for resolvers that do not return a mocked response. #772
Replies: 3 comments 2 replies
-
After digging through the source, it looks like the header |
Beta Was this translation helpful? Give feedback.
-
Hey, @chiller-whale. Could you please include your mocks (request handlers, how you call Returning undefined is a correct strategy for response resolvers since 0.28.1. Please, could you check that you're running the latest version of $ npm install msw@latest
# or
$ yarn add msw@latest |
Beta Was this translation helpful? Give feedback.
-
This is a known issue (see #676) and it's currently being addressed in #962/#923. |
Beta Was this translation helpful? Give feedback.
-
I am using
supertest
to test an API that integrates with a 3rd party http service. I have unhandled requests configured to error, but noticed that an error was being caused by a requests being sent with supertest. I was able to resolve this by using conditional mocking with:This solved the issue of erroring, but I now get a console.warn for each of those tests reading:
[MSW] Expected a mocking resolver function to return a mocked response Object, but got: undefined. Original response is going to be used instead.
It would be great if this warn could be disabled. If not globally, then through the
res
parameter so it could be handled on a per handler basis.Beta Was this translation helpful? Give feedback.
All reactions