Skip to content

Commit ee43130

Browse files
christophpurrermeta-codesync[bot]
authored andcommitted
Bridgeless-context ThemedReactContextTest (#59276)
Summary: Pull Request resolved: #59276 Migrate `ThemedReactContextTest` from the deprecated `createCatalystContextForTest` helper to `createTestReactApplicationContext`, so the test builds a bridgeless context directly. Stub the feature flags before context creation, since the bridgeless context reads them during init. Changelog: [Internal] Reviewed By: javache Differential Revision: D126574361 fbshipit-source-id: 5cfafd5943101549354fd13acc8489e738b7e731
1 parent 44eb927 commit ee43130

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎packages/react-native/ReactAndroid/src/test/java/com/facebook/react/uimanager/ThemedReactContextTest.kt‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import android.view.Window
1111
import com.facebook.react.bridge.ReactApplicationContext
1212
import com.facebook.react.bridge.ReactTestHelper
1313
import com.facebook.react.interfaces.ExtraWindowEventListener
14+
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsForTests
1415
import com.facebook.testutils.shadows.ShadowSoLoader
1516
import org.junit.Before
1617
import org.junit.Test
@@ -31,7 +32,9 @@ class ThemedReactContextTest {
3132

3233
@Before
3334
fun setUp() {
34-
reactApplicationContext = ReactTestHelper.createCatalystContextForTest()
35+
ReactNativeFeatureFlagsForTests.setUp()
36+
reactApplicationContext =
37+
ReactTestHelper.createTestReactApplicationContext(RuntimeEnvironment.getApplication())
3538
themedReactContext =
3639
ThemedReactContext(reactApplicationContext, RuntimeEnvironment.getApplication(), null, -1)
3740
window = mock()

0 commit comments

Comments
 (0)