From ee38c4a40c9d301c30fad4d127e8d020a6100b8e Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Mon, 12 Jun 2023 13:37:39 -0700 Subject: [PATCH] introduce build boilerplate for ios unit tests (#37811) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37811 Changelog: [Internal] i am looking to add ios unit tests to venice and this is the first unit test suite that will test native ios code in the new architecture afaik, so i wanted to open this up to discussion. currently, all `XCTest` in `react-native-github` are coupled with the `RNTester` target. my main qualm with this is i am concerned that it won't scale well. currently we have only ~30ish tests but ultimately if we want a proper testing suite, surely this count will be in the hundreds and that won't be able to reasonably live in a single test target. however, the trade is that this test will not show up in RNTester. i have added a unit test to RNTester before in D31949237, however the experience was extremely painful as i had to manually update the `project.pbxproj` to include my file, and i had to manually determine what hex value was the next one (for whatever reason, this doesn't increment at the endian...). i am wondering if we can treat the current unit testing experience in RNTester as pretty much maintenance mode and start thinking of a improved version starting with something more modular like this. Reviewed By: cipolleschi Differential Revision: D46467229 fbshipit-source-id: 09de9cf8bc5f8b9c86abcaf7750a6f63686d8d1a --- .../react/bridgeless/iostests/RCTHostTests.mm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm diff --git a/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm b/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm new file mode 100644 index 00000000000..13fcf49f16a --- /dev/null +++ b/packages/react-native/ReactCommon/react/bridgeless/iostests/RCTHostTests.mm @@ -0,0 +1,19 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTHostTests : XCTestCase +@end + +@implementation RCTHostTests + +- (void)testHost +{ +} + +@end