mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-03 22:48:25 +08:00
Fix stacktrace parsing for JS
Reviewed By: adamjernst, indragiek Differential Revision: D7734756 fbshipit-source-id: 7111932386bb5fede83b5f55a946549b1dc6c402
This commit is contained in:
committed by
Facebook Github Bot
parent
f80000b9e7
commit
37d28be2d9
@@ -17,6 +17,16 @@ import org.robolectric.RobolectricTestRunner;
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class StackTraceHelperTest {
|
||||
|
||||
@Test
|
||||
public void testParseAlternateFormatStackFrameWithMethod() {
|
||||
final StackFrame frame = StackTraceHelper.convertJsStackTrace(
|
||||
"at func1 (/path/to/file.js:2:18)")[0];
|
||||
assertThat(frame.getMethod()).isEqualTo("func1");
|
||||
assertThat(frame.getFileName()).isEqualTo("file.js");
|
||||
assertThat(frame.getLine()).isEqualTo(2);
|
||||
assertThat(frame.getColumn()).isEqualTo(18);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParseStackFrameWithMethod() {
|
||||
final StackFrame frame = StackTraceHelper.convertJsStackTrace(
|
||||
|
||||
Reference in New Issue
Block a user