mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-08 17:46:35 +08:00
Ability to run unit tests in react-android-github via gradle
Reviewed By: mkonicek Differential Revision: D2699804 fb-gh-sync-id: 7b31287407bacf2e8e3de6ee1c723a11bb2a0f27
This commit is contained in:
committed by
facebook-github-bot-6
parent
be285c43d1
commit
01983c2f0a
@@ -53,7 +53,7 @@ import static org.fest.assertions.api.Assertions.assertThat;
|
||||
* Tests for {@link AsyncStorageModule}.
|
||||
*/
|
||||
@PrepareForTest({Arguments.class})
|
||||
@PowerMockIgnore({"org.mockito.*", "org.robolectric.*", "android.*"})
|
||||
@PowerMockIgnore({"org.mockito.*", "org.robolectric.*", "android.*", "org.json.*"})
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class AsyncStorageModuleTest {
|
||||
|
||||
|
||||
@@ -77,9 +77,9 @@ public class TimingModuleTest {
|
||||
PowerMockito.mockStatic(ReactChoreographer.class);
|
||||
when(ReactChoreographer.getInstance()).thenReturn(mChoreographerMock);
|
||||
|
||||
CatalystInstance catalystInstance = mock(CatalystInstance.class);
|
||||
CatalystInstance reactInstance = mock(CatalystInstance.class);
|
||||
ReactApplicationContext reactContext = mock(ReactApplicationContext.class);
|
||||
when(reactContext.getCatalystInstance()).thenReturn(catalystInstance);
|
||||
when(reactContext.getCatalystInstance()).thenReturn(reactInstance);
|
||||
|
||||
mCurrentTimeNs = 0;
|
||||
mPostFrameCallbackHandler = new PostFrameCallbackHandler();
|
||||
@@ -92,7 +92,7 @@ public class TimingModuleTest {
|
||||
|
||||
mTiming = new Timing(reactContext);
|
||||
mJSTimersMock = mock(JSTimersExecution.class);
|
||||
when(catalystInstance.getJSModule(JSTimersExecution.class)).thenReturn(mJSTimersMock);
|
||||
when(reactInstance.getJSModule(JSTimersExecution.class)).thenReturn(mJSTimersMock);
|
||||
mTiming.initialize();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user