@@ -17,7 +17,7 @@ describe('React Native plugin', function () {
17
17
} ) ;
18
18
19
19
describe ( '_normalizeData()' , function ( ) {
20
- it ( 'should normalize culprit and frame filenames/URLs from app' , function ( ) {
20
+ it ( 'should normalize culprit and frame filenames/URLs from . app directory ' , function ( ) {
21
21
var data = {
22
22
project : '2' ,
23
23
logger : 'javascript' ,
@@ -53,6 +53,38 @@ describe('React Native plugin', function () {
53
53
assert . equal ( frames [ 1 ] . filename , '/file2.js' ) ;
54
54
} ) ;
55
55
56
+ it ( 'should normalize culprit and frame filenames/URLs from stacktrace interface' , function ( ) {
57
+ var data = {
58
+ project : '2' ,
59
+ logger : 'javascript' ,
60
+ platform : 'javascript' ,
61
+
62
+ culprit : 'file:///var/mobile/Containers/Bundle/Application/ABC/123.app/app.js' ,
63
+ message : 'Error: crap' ,
64
+
65
+ stacktrace : {
66
+ frames : [ {
67
+ filename : 'file:///var/containers/Bundle/Application/ABC/123.app/file1.js' ,
68
+ lineno : 10 ,
69
+ colno : 11 ,
70
+ 'function' : 'broken'
71
+
72
+ } , {
73
+ filename : 'file:///var/mobile/Containers/Bundle/Application/ABC/123.app/file2.js' ,
74
+ lineno : 12 ,
75
+ colno : 13 ,
76
+ 'function' : 'lol'
77
+ } ]
78
+ }
79
+ } ;
80
+ reactNativePlugin . _normalizeData ( data ) ;
81
+
82
+ assert . equal ( data . culprit , '/app.js' ) ;
83
+ var frames = data . stacktrace . frames ;
84
+ assert . equal ( frames [ 0 ] . filename , '/file1.js' ) ;
85
+ assert . equal ( frames [ 1 ] . filename , '/file2.js' ) ;
86
+ } ) ;
87
+
56
88
it ( 'should normalize culprit and frame filenames/URLs from CodePush' , function ( ) {
57
89
var data = {
58
90
project : '2' ,
0 commit comments