Detox repo 上的一个常见问题是如何在测试中登录 Facebook ( https://github.com/wix/detox/issues/287 )。
答案:“模拟 FB API 以返回有效会话,无需实际登录过程。”</p>
当然!听起来是个好主意,但是……怎么做?有人可以指出我正确的方向吗?
Detox 码头提到react-native-repackager ( https://github.com/wix/detox/blob/master/docs/Guide.Mocking.md ) 可以用来SomeFile.e2e.js代替SomeFile.js但我不知道如何模拟一个库在node_modules/(本例中为 react-native-fbsdk)。