From c470e5d653fec0b08df58838a54b21ee8e0eb56f Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Wed, 2 Oct 2024 08:55:27 +0200 Subject: [PATCH] test(apple): remove unused test suite (#2268) --- example/Example-Tests.podspec | 1 - .../ReactNativePerformanceTests.m | 66 ------------------- scripts/build/xcodebuild.sh | 4 -- 3 files changed, 71 deletions(-) delete mode 100644 example/ios/ExampleTests/ReactNativePerformanceTests.m diff --git a/example/Example-Tests.podspec b/example/Example-Tests.podspec index 6ca1f37d2..f74c776a6 100644 --- a/example/Example-Tests.podspec +++ b/example/Example-Tests.podspec @@ -22,5 +22,4 @@ Pod::Spec.new do |s| s.user_target_xcconfig = { 'ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES' => '$(inherited)' } s.source_files = 'ios/ExampleTests/**/*.{m,swift}' - s.osx.exclude_files = 'ios/ExampleTests/ReactNativePerformanceTests.m' end diff --git a/example/ios/ExampleTests/ReactNativePerformanceTests.m b/example/ios/ExampleTests/ReactNativePerformanceTests.m deleted file mode 100644 index e535e7f83..000000000 --- a/example/ios/ExampleTests/ReactNativePerformanceTests.m +++ /dev/null @@ -1,66 +0,0 @@ -#import - -#import -#import -#import - -@interface ReactNativePerformanceTests : XCTestCase -@end - -@implementation ReactNativePerformanceTests { - RCTDevSettings *_devSettings; - BOOL _wasDebuggingRemotely; -} - -- (void)setUp -{ - // Make sure that remote debugging is disabled otherwise we'll get a RedBox. - _devSettings = [[RCTDevSettings alloc] init]; - if (_devSettings.isDebuggingRemotely) { - _wasDebuggingRemotely = YES; - _devSettings.isDebuggingRemotely = NO; - } - - RCTSetLogFunction(^(__unused RCTLogLevel level, - __unused RCTLogSource source, - __unused NSString *fileName, - __unused NSNumber *lineNumber, - __unused NSString *message){ - // noop - }); - RCTSetFatalHandler(nil); -} - -- (void)tearDown -{ - if (_wasDebuggingRemotely) { - _devSettings.isDebuggingRemotely = YES; - } - - RCTSetLogFunction(nil); -} - -- (void)testBridgeInitializationPerformance -{ - [self measureBlock:^{ - XCTestExpectation *expectation = - [self expectationForNotification:RCTJavaScriptDidLoadNotification object:nil handler:nil]; - RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:nil]; - [self waitForExpectations:@[expectation] timeout:5]; - [bridge invalidate]; - }]; -} - -// MARK: - RCTBridgeDelegate details - -- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge -{ - return [NSBundle.mainBundle URLForResource:@"main" withExtension:@"jsbundle" subdirectory:nil]; -} - -- (NSArray> *)extraModulesForBridge:(RCTBridge *)bridge -{ - return @[]; -} - -@end diff --git a/scripts/build/xcodebuild.sh b/scripts/build/xcodebuild.sh index e9b6521af..e2e425ccd 100755 --- a/scripts/build/xcodebuild.sh +++ b/scripts/build/xcodebuild.sh @@ -17,8 +17,6 @@ if [[ $platform == ios/* ]]; then else destination='-destination "generic/platform=iOS Simulator"' fi - - skip_testing='-skip-testing:ReactTestAppTests/ReactNativePerformanceTests' elif [[ $platform == macos/* ]]; then destination='' skip_testing='' @@ -32,8 +30,6 @@ elif [[ $platform == visionos/* ]]; then else destination='-destination "generic/platform=visionOS Simulator"' fi - - skip_testing='-skip-testing:ReactTestAppTests/ReactNativePerformanceTests' else echo "Cannot detect platform: $workspace" exit 1