Fix stacktrace parsing for JS

Reviewed By: adamjernst, indragiek

Differential Revision: D7734756

fbshipit-source-id: 7111932386bb5fede83b5f55a946549b1dc6c402
This commit is contained in:
Max Sherman
2018-04-23 22:05:32 -07:00
committed by Facebook Github Bot
parent f80000b9e7
commit 37d28be2d9
2 changed files with 26 additions and 8 deletions

View File

@@ -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(