mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-10 22:36:01 +00:00
Fix disabling of RCTDevMenu for tests on iOS 9.3
After upgrading to Xcode 7.3, the test bundle is being loaded before the rest of the app. We need to ensure +[RCTDevMenu load] is called before we remove it from the set of native modules.
This commit is contained in:
parent
0e74362e4c
commit
88f6191a61
@ -34,18 +34,31 @@ extern NSMutableArray *RCTGetModuleClasses(void);
|
|||||||
- (void)setUp;
|
- (void)setUp;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@interface RCTDevMenuDisabler : RCTDevMenu
|
||||||
|
@end
|
||||||
|
|
||||||
@interface RealmReactTests : RealmJSTests
|
@interface RealmReactTests : RealmJSTests
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface RealmReactChromeTests : RealmReactTests
|
@interface RealmReactChromeTests : RealmReactTests
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
@implementation RCTDevMenuDisabler
|
||||||
|
|
||||||
|
+ (void)load {
|
||||||
|
// +[RCTDevMenu load] is guaranteed to have been called since it's the superclass.
|
||||||
|
// We remove it since it interferes with us fully controlling the executor class.
|
||||||
|
NSMutableArray *moduleClasses = RCTGetModuleClasses();
|
||||||
|
[moduleClasses removeObject:[RCTDevMenu class]];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
||||||
@implementation RealmReactTests
|
@implementation RealmReactTests
|
||||||
|
|
||||||
+ (void)load {
|
+ (void)load {
|
||||||
NSMutableArray *moduleClasses = RCTGetModuleClasses();
|
|
||||||
[moduleClasses removeObject:[RCTDevMenu class]];
|
|
||||||
|
|
||||||
RCTAddLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
|
RCTAddLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
|
||||||
NSAssert(level < RCTLogLevelError, RCTFormatLog(nil, level, fileName, lineNumber, message));
|
NSAssert(level < RCTLogLevelError, RCTFormatLog(nil, level, fileName, lineNumber, message));
|
||||||
});
|
});
|
||||||
@ -224,6 +237,7 @@ extern NSMutableArray *RCTGetModuleClasses(void);
|
|||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
@implementation RealmReactChromeTests
|
@implementation RealmReactChromeTests
|
||||||
|
|
||||||
+ (Class)executorClass {
|
+ (Class)executorClass {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user