'Detox mocking using file extension e2e.js
I'm using Detox as an end to end testing framework for a react native application. I'd like to mock the results of API requests in order to reduce flakiness and time for testing.
According to the documentation, I should be able to have Metro overwrite a module using the file extension e2e.js.
I'm unable to get this working and I'm not entirely sure why. Most documentation and existing questions relate to using react-native-repackager, but as of RN 0.55.0, this is no longer needed.
Any help/ideas would be appreciated!
EDIT:
RN_SRC_EXT=e2e.js react-native start works fine
RN_SRC_EXT=e2e.js xcodebuild -project <other params> as the detox build script and detox test -c ios.sim.release does not work
Solution 1:[1]
for me, there was a mismatch between binaryPath and actual binary path.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | mharti |
