Closed whalemare closed 3 years ago
@whalemare that would make a wonderful API, but I don't see how it can be technically possible, as the bundle/mocking is usually set up ahead of time (i.e. before the test execution even begins).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back.
Thank you for your contributions!
For more information on bots in this reporsitory, read this discussion.
The issue has been closed for inactivity.
Is your feature request related to a problem? Please describe. As developer, I like when my tests predictable and reproducible. Detox giving to us great instruments for making taps, swipes, screenshots and other stuff that really helps with e2e tests. But missing one part of mocking, for achieve reproducibility.
I want to make my per test environment unique for this test case. If I check errors, I want to mock all my requests to errors. For achieve this, I want to change implementation of my
Service
orRepository
as I can do it with Jest.But Detox is gray-box testing tool and can get to us mocking only via metro bundler tool (taking
*e2e.ts
files instead original), that not usable solution when you need test more that 1 test case.Describe the solution you'd like I want to get access to my runtime code, for change implementation of some services (for mocking some js part or native module implementations). In native android development, we can do it with help of DI tools (like Dagger solutions here). I want to get the same mechanism of mocking in Detox
Describe alternatives you've considered