-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detox with MSW #3808
Comments
Hi @xpt300, I don't have experience using MSW, so I am unable to provide advice on how to set it up for your Detox tests. However, I recommend joining our Discord server and asking for help there, as someone may have already integrated MSW with Detox and may be able to assist you. |
Ok I finally found where it came from and the answer is stupid haha |
Thank you for sharing that the issue was resolved. It's helpful to know about this framework as it may be useful for others who are looking for it 👍🏼 |
@xpt300 do you mind sharing more info how you implemented the mocking? |
Description
Hello,
I would like to use MSW to intercept the call api and return my fixtures.
After several tries I am still stuck with "Network request failed".
Can you give me some advice on how to set up MSW for detox?
attached my class CustomDetoxEnvironment
I tested the api mock with a simple jest test that works, to be sure that the problem was not a bad routing in MSW and I checked well the urls are good between the MSW server and the fetch of my application.
I am wondering if it is possible to use MSW with detox? Is there anything missing?
This is my jest config
and this is my simple test
jest.setup.js
Your environment
Detox version: 20.1.1
React Native version: 0.70.6
Node version: 16.13.2
Device model: Iphone 13
OS: 15.0
Test-runner (select one): jest
The text was updated successfully, but these errors were encountered: