Skip to content

Commit 5da8f74

Browse files
Bridgeless-context ThemedReactContextTest (#59276)
Summary: 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] Differential Revision: D126574361
1 parent 1257de5 commit 5da8f74

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)