mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Fix bridge tests
Summary:The `RCTDevMenu.hotLoadingAvailable` check always returned YES if `bridge.bundleURL` was nil. This caused the `setHotLoadingEnabled:` method to repeatedly reload the bridge, resulting in the following tests failing: `- [RCTBridgeTests testHookRegistration];` `- [RCTBridgeTests testCallNativeMethod];` Also, the `RUN_RUNLOOP_WHILE()` macro did not actually assert when timing out, and the logic in `- [RCTBridgeTests tearDown];` was broken in such a way that tests would always take 5 seconds to run (and then timeout silently). This adds an assertion, and removes the broken nil check for `jsExecutor`. Reviewed By: majak Differential Revision: D2988885 fb-gh-sync-id: 91307585ac8acb0181f0cddeeddf6cb4b198e4fe shipit-source-id: 91307585ac8acb0181f0cddeeddf6cb4b198e4fe
This commit is contained in:
committed by
Facebook Github Bot 3
parent
5a53d90003
commit
8d44c2db4f
@@ -581,7 +581,7 @@ RCT_EXPORT_METHOD(reload)
|
||||
|
||||
- (BOOL)hotLoadingAvailable
|
||||
{
|
||||
return !_bridge.bundleURL.fileURL; // Only works when running from server
|
||||
return _bridge.bundleURL && !_bridge.bundleURL.fileURL; // Only works when running from server
|
||||
}
|
||||
|
||||
- (void)setHotLoadingEnabled:(BOOL)enabled
|
||||
|
||||
Reference in New Issue
Block a user