mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Fix RNTesterUnitTests build by importing react/bridging/ArrayBuffer.h (#57518)
Summary:
Imports `react/bridging/ArrayBuffer.h` in `RCTTurboModuleArrayBufferTests.mm`, so `RNTesterUnitTests` compiles and `yarn test-ios` works on main again.
The test uses `detail::OwnedBytesBuffer`, which lives in `facebook::react::detail` in that header, but never imports it, and nothing in its include chain provides it, so `detail` resolves to `facebook::jsi::detail` and the target fails to compile before running a single test. The file already has `using namespace facebook::react;`, so the import is the entire fix. CI stays green because the `test_ios_rntester` jobs only build the app scheme and never compile `RNTesterUnitTests`, which means this file has never compiled in the repo since it landed in 54b88d9dea, and the `yarn test-ios` flow the contributing docs point at is the only thing that compiles it.
```
RCTTurboModuleArrayBufferTests.mm:294:42: error: use of undeclared identifier 'detail'; did you mean 'facebook::jsi::detail'?
RCTTurboModuleArrayBufferTests.mm:294:50: error: no member named 'OwnedBytesBuffer' in namespace 'facebook::jsi::detail'
```
## Changelog:
[INTERNAL] [FIXED] - Fix RNTesterUnitTests build by importing react/bridging/ArrayBuffer.h in RCTTurboModuleArrayBufferTests
Pull Request resolved: https://github.com/react/react-native/pull/57518
Test Plan:
- Without the import, `xcodebuild build-for-testing -workspace RNTesterPods.xcworkspace -scheme RNTester -sdk iphonesimulator` fails with the errors above, zero tests run. With it, the same build succeeds with no errors in the file.
- The patched file passes `clang-format --dry-run --Werror`.
- With the target compiling, the suite executes for the first time: 162 tests, 0 failures, including all RCTTurboModuleArrayBufferTests cases passing.
- Reproduced on GitHub-hosted macOS runners: the same build [fails on pristine main](https://github.com/ramonclaudio/react-native/actions/runs/29134707109) with the errors above and [succeeds with this change](https://github.com/ramonclaudio/react-native/actions/runs/29134707611).
Reviewed By: javache
Differential Revision: D111707925
Pulled By: cortinico
fbshipit-source-id: ac21bcbcd55ba214b2d9f13796198ddcdbec12c1
This commit is contained in:
1 parent
4be68ef785
commit
e7bb11ae16
1 file changed
+1
@@ -11,6 +11,7 @@
|
||||
#import <ReactCommon/RCTTurboModule.h>
|
||||
#import <ReactCommon/TestCallInvoker.h>
|
||||
#import <hermes/hermes.h>
|
||||
#import <react/bridging/ArrayBuffer.h>
|
||||
|
||||
#import <list>
|
||||
#import <vector>
|
||||
|
||||
Reference in new issue
Block a user