mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-04 09:27:53 +08:00
Let JS modules use strings instead of ids on Android
Reviewed By: nicklockwood Differential Revision: D3229626 fb-gh-sync-id: f8b2e8c9fc0d25d67f623cdbbe9930a02a40d1de fbshipit-source-id: f8b2e8c9fc0d25d67f623cdbbe9930a02a40d1de
This commit is contained in:
committed by
Facebook Github Bot 4
parent
5071907b27
commit
041185edfd
@@ -49,11 +49,11 @@ public class JavaScriptModuleConfigTest {
|
||||
|
||||
JsonNode intMethodNode = methods.get("intMethod");
|
||||
assertThat(intMethodNode).isNotNull();
|
||||
assertThat(intMethodNode.get("methodID").asInt()).isEqualTo(0);
|
||||
assertThat(intMethodNode.get("methodID").asText()).isEqualTo("intMethod");
|
||||
|
||||
JsonNode stringMethod = methods.get("stringMethod");
|
||||
assertThat(stringMethod).isNotNull();
|
||||
assertThat(stringMethod.get("methodID").asInt()).isEqualTo(1);
|
||||
assertThat(stringMethod.get("methodID").asText()).isEqualTo("stringMethod");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -69,11 +69,11 @@ public class JavaScriptModuleConfigTest {
|
||||
|
||||
JsonNode someModuleNode = node.get("SomeModule");
|
||||
assertThat(someModuleNode).isNotNull();
|
||||
int someModuleID = someModuleNode.get("moduleID").asInt();
|
||||
String someModuleID = someModuleNode.get("moduleID").asText();
|
||||
|
||||
JsonNode otherModuleNode = node.get("OtherModule");
|
||||
assertThat(otherModuleNode).isNotNull();
|
||||
int otherModuleID = otherModuleNode.get("moduleID").asInt();
|
||||
String otherModuleID = otherModuleNode.get("moduleID").asText();
|
||||
assertThat(otherModuleID)
|
||||
.isNotEqualTo(someModuleID);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user