1+ // jscs:disable maximumLineLength
12/* global StackFrame: false, ErrorStackParser: false, CapturedExceptions: false */
2- describe ( 'ErrorStackParser' , function ( ) {
3- describe ( '#parse' , function ( ) {
3+ describe ( 'ErrorStackParser' , function ( ) {
4+ describe ( '#parse' , function ( ) {
45 var unit = ErrorStackParser ;
5- it ( 'should not parse IE 9 Error' , function ( ) {
6- expect ( function ( ) {
6+ it ( 'should not parse IE 9 Error' , function ( ) {
7+ expect ( function ( ) {
78 unit . parse ( CapturedExceptions . IE_9 ) ;
89 } ) . toThrow ( new Error ( 'Cannot parse given Error object' ) ) ;
910 } ) ;
1011
11- it ( 'should parse Safari 6 Error.stack' , function ( ) {
12+ it ( 'should parse Safari 6 Error.stack' , function ( ) {
1213 var stackFrames = unit . parse ( CapturedExceptions . SAFARI_6 ) ;
1314 expect ( stackFrames ) . toBeTruthy ( ) ;
1415 expect ( stackFrames . length ) . toBe ( 3 ) ;
@@ -17,7 +18,7 @@ describe('ErrorStackParser', function () {
1718 expect ( stackFrames [ 2 ] ) . toMatchStackFrame ( [ 'onclick' , undefined , 'http://path/to/file.js' , 82 ] ) ;
1819 } ) ;
1920
20- it ( 'should parse Safari 7 Error.stack' , function ( ) {
21+ it ( 'should parse Safari 7 Error.stack' , function ( ) {
2122 var stackFrames = unit . parse ( CapturedExceptions . SAFARI_7 ) ;
2223 expect ( stackFrames ) . toBeTruthy ( ) ;
2324 expect ( stackFrames . length ) . toBe ( 3 ) ;
@@ -26,7 +27,7 @@ describe('ErrorStackParser', function () {
2627 expect ( stackFrames [ 2 ] ) . toMatchStackFrame ( [ 'bar' , undefined , 'http://path/to/file.js' , 108 , 107 ] ) ;
2728 } ) ;
2829
29- it ( 'should parse Safari 8 Error.stack' , function ( ) {
30+ it ( 'should parse Safari 8 Error.stack' , function ( ) {
3031 var stackFrames = unit . parse ( CapturedExceptions . SAFARI_8 ) ;
3132 expect ( stackFrames ) . toBeTruthy ( ) ;
3233 expect ( stackFrames . length ) . toBe ( 3 ) ;
@@ -46,7 +47,7 @@ describe('ErrorStackParser', function () {
4647 expect ( stackFrames [ 4 ] ) . toMatchStackFrame ( [ 'global code' , undefined , 'http://localhost:8080/file.js' , 33 , 18 ] ) ;
4748 } ) ;
4849
49- it ( 'should parse Firefox 31 Error.stack' , function ( ) {
50+ it ( 'should parse Firefox 31 Error.stack' , function ( ) {
5051 var stackFrames = unit . parse ( CapturedExceptions . FIREFOX_31 ) ;
5152 expect ( stackFrames ) . toBeTruthy ( ) ;
5253 expect ( stackFrames . length ) . toBe ( 2 ) ;
@@ -65,15 +66,15 @@ describe('ErrorStackParser', function () {
6566 expect ( stackFrames [ 4 ] ) . toMatchStackFrame ( [ undefined , undefined , 'http://localhost:8080/file.js' , 33 , 9 ] ) ;
6667 } ) ;
6768
68- it ( 'should parse function names containing @ in Firefox 43 Error.stack' , function ( ) {
69+ it ( 'should parse function names containing @ in Firefox 43 Error.stack' , function ( ) {
6970 var stackFrames = unit . parse ( CapturedExceptions . FIREFOX_43_FUNCTION_NAME_WITH_AT_SIGN ) ;
7071 expect ( stackFrames ) . toBeTruthy ( ) ;
7172 expect ( stackFrames . length ) . toBe ( 2 ) ;
7273 expect ( stackFrames [ 0 ] ) . toMatchStackFrame ( [ 'obj["@fn"]' , undefined , 'Scratchpad/1' , 10 , 29 ] ) ;
7374 expect ( stackFrames [ 1 ] ) . toMatchStackFrame ( [ undefined , undefined , 'Scratchpad/1' , 11 , 1 ] ) ;
7475 } ) ;
7576
76- it ( 'should parse V8 Error.stack' , function ( ) {
77+ it ( 'should parse V8 Error.stack' , function ( ) {
7778 var stackFrames = unit . parse ( CapturedExceptions . CHROME_15 ) ;
7879 expect ( stackFrames ) . toBeTruthy ( ) ;
7980 expect ( stackFrames . length ) . toBe ( 4 ) ;
@@ -83,20 +84,20 @@ describe('ErrorStackParser', function () {
8384 expect ( stackFrames [ 3 ] ) . toMatchStackFrame ( [ undefined , undefined , 'http://path/to/file.js' , 24 , 4 ] ) ;
8485 } ) ;
8586
86- it ( 'should parse V8 entries with no location' , function ( ) {
87- var stackFrames = unit . parse ( { stack : " Error\n at Array.forEach (native)" } ) ;
87+ it ( 'should parse V8 entries with no location' , function ( ) {
88+ var stackFrames = unit . parse ( { stack : ' Error\n at Array.forEach (native)' } ) ;
8889 expect ( stackFrames . length ) . toBe ( 1 ) ;
8990 expect ( stackFrames [ 0 ] ) . toMatchStackFrame ( [ 'Array.forEach' , undefined , '(native)' , undefined , undefined ] ) ;
9091 } ) ;
9192
92- it ( 'should parse V8 Error.stack entries with port numbers' , function ( ) {
93+ it ( 'should parse V8 Error.stack entries with port numbers' , function ( ) {
9394 var stackFrames = unit . parse ( CapturedExceptions . CHROME_36 ) ;
9495 expect ( stackFrames ) . toBeTruthy ( ) ;
9596 expect ( stackFrames . length ) . toBe ( 2 ) ;
9697 expect ( stackFrames [ 0 ] ) . toMatchStackFrame ( [ 'dumpExceptionError' , undefined , 'http://localhost:8080/file.js' , 41 , 27 ] ) ;
9798 } ) ;
9899
99- it ( 'should parse error stacks with Constructors' , function ( ) {
100+ it ( 'should parse error stacks with Constructors' , function ( ) {
100101 var stackFrames = unit . parse ( CapturedExceptions . CHROME_46 ) ;
101102 expect ( stackFrames ) . toBeTruthy ( ) ;
102103 expect ( stackFrames . length ) . toBe ( 2 ) ;
@@ -115,7 +116,7 @@ describe('ErrorStackParser', function () {
115116 expect ( stackFrames [ 4 ] ) . toMatchStackFrame ( [ undefined , undefined , 'http://localhost:8080/file.js' , 31 , 13 ] ) ;
116117 } ) ;
117118
118- it ( 'should parse IE 10 Error stacks' , function ( ) {
119+ it ( 'should parse IE 10 Error stacks' , function ( ) {
119120 var stackFrames = unit . parse ( CapturedExceptions . IE_10 ) ;
120121 expect ( stackFrames ) . toBeTruthy ( ) ;
121122 expect ( stackFrames . length ) . toBe ( 3 ) ;
@@ -124,7 +125,7 @@ describe('ErrorStackParser', function () {
124125 expect ( stackFrames [ 2 ] ) . toMatchStackFrame ( [ 'bar' , undefined , 'http://path/to/file.js' , 82 , 1 ] ) ;
125126 } ) ;
126127
127- it ( 'should parse IE 11 Error stacks' , function ( ) {
128+ it ( 'should parse IE 11 Error stacks' , function ( ) {
128129 var stackFrames = unit . parse ( CapturedExceptions . IE_11 ) ;
129130 expect ( stackFrames ) . toBeTruthy ( ) ;
130131 expect ( stackFrames . length ) . toBe ( 3 ) ;
@@ -155,7 +156,7 @@ describe('ErrorStackParser', function () {
155156 expect ( stackFrames [ 4 ] ) . toMatchStackFrame ( [ undefined , undefined , 'http://localhost:8080/file.js' , 31 , 13 ] ) ;
156157 } ) ;
157158
158- it ( 'should parse Opera 9.27 Error messages' , function ( ) {
159+ it ( 'should parse Opera 9.27 Error messages' , function ( ) {
159160 var stackFrames = unit . parse ( CapturedExceptions . OPERA_927 ) ;
160161 expect ( stackFrames ) . toBeTruthy ( ) ;
161162 expect ( stackFrames . length ) . toBe ( 3 ) ;
@@ -164,7 +165,7 @@ describe('ErrorStackParser', function () {
164165 expect ( stackFrames [ 2 ] ) . toMatchStackFrame ( [ undefined , undefined , 'http://path/to/file.js' , 18 ] ) ;
165166 } ) ;
166167
167- it ( 'should parse Opera 10 Error messages' , function ( ) {
168+ it ( 'should parse Opera 10 Error messages' , function ( ) {
168169 var stackFrames = unit . parse ( CapturedExceptions . OPERA_10 ) ;
169170 expect ( stackFrames ) . toBeTruthy ( ) ;
170171 expect ( stackFrames . length ) . toBe ( 7 ) ;
@@ -177,7 +178,7 @@ describe('ErrorStackParser', function () {
177178 expect ( stackFrames [ 6 ] ) . toMatchStackFrame ( [ undefined , undefined , 'http://path/to/file.js' , 15 ] ) ;
178179 } ) ;
179180
180- it ( 'should parse Opera 11 Error messages' , function ( ) {
181+ it ( 'should parse Opera 11 Error messages' , function ( ) {
181182 var stackFrames = unit . parse ( CapturedExceptions . OPERA_11 ) ;
182183 expect ( stackFrames ) . toBeTruthy ( ) ;
183184 expect ( stackFrames . length ) . toBe ( 4 ) ;
@@ -187,7 +188,7 @@ describe('ErrorStackParser', function () {
187188 expect ( stackFrames [ 3 ] ) . toMatchStackFrame ( [ undefined , undefined , 'http://path/to/file.js' , 15 ] ) ;
188189 } ) ;
189190
190- it ( 'should parse Opera 25 Error stacks' , function ( ) {
191+ it ( 'should parse Opera 25 Error stacks' , function ( ) {
191192 var stackFrames = unit . parse ( CapturedExceptions . OPERA_25 ) ;
192193 expect ( stackFrames ) . toBeTruthy ( ) ;
193194 expect ( stackFrames . length ) . toBe ( 3 ) ;
@@ -196,11 +197,11 @@ describe('ErrorStackParser', function () {
196197 expect ( stackFrames [ 2 ] ) . toMatchStackFrame ( [ 'bar' , undefined , 'http://path/to/file.js' , 108 , 168 ] ) ;
197198 } ) ;
198199
199- it ( 'should handle newlines in Error stack messages' , function ( ) {
200+ it ( 'should handle newlines in Error stack messages' , function ( ) {
200201 var stackFrames = unit . parse ( {
201- stack : " Error: Problem at this\nlocation. Error code:1234\n" +
202- " at http://path/to/file.js:47:22\n" +
203- " at foo (http://path/to/file.js:52:15)"
202+ stack : ' Error: Problem at this\nlocation. Error code:1234\n' +
203+ ' at http://path/to/file.js:47:22\n' +
204+ ' at foo (http://path/to/file.js:52:15)'
204205 } ) ;
205206
206207 expect ( stackFrames . length ) . toBe ( 2 ) ;
0 commit comments