mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-03 22:48:25 +08:00
Convert modules to use @ReactModule instead of getName()
Reviewed By: astreet Differential Revision: D3334273 fbshipit-source-id: a33bf72c5c184844885ef3ef610a05d9c102c8ea
This commit is contained in:
committed by
Facebook Github Bot 2
parent
9965642ebc
commit
c64213653e
@@ -12,6 +12,7 @@ import javax.annotation.Nullable;
|
||||
|
||||
import com.facebook.react.bridge.BaseJavaModule;
|
||||
import com.facebook.react.bridge.ReactMethod;
|
||||
import com.facebook.react.bridge.annotations.ReactModule;
|
||||
|
||||
import static junit.framework.Assert.assertFalse;
|
||||
import static junit.framework.Assert.assertTrue;
|
||||
@@ -19,17 +20,13 @@ import static junit.framework.Assert.assertTrue;
|
||||
/**
|
||||
* NativeModule for tests that allows assertions from JS to propagate to Java.
|
||||
*/
|
||||
@ReactModule(name = "Assert")
|
||||
public class AssertModule extends BaseJavaModule {
|
||||
|
||||
private boolean mGotSuccess;
|
||||
private boolean mGotFailure;
|
||||
private @Nullable String mFirstFailureStackTrace;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Assert";
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void fail(String stackTrace) {
|
||||
if (!mGotFailure) {
|
||||
|
||||
Reference in New Issue
Block a user