@@ -6,64 +6,64 @@ describe('StackParser', function () {
66 var stackFrames = unit . parse ( CapturedExceptions . SAFARI_6 ) ;
77 expect ( stackFrames ) . toBeTruthy ( ) ;
88 expect ( stackFrames . length ) . toBe ( 3 ) ;
9- expect ( stackFrames [ 0 ] ) . toEqual ( new StackFrame ( '' , [ ] , 'http://path/to/file.js' , '48' ) ) ;
10- expect ( stackFrames [ 1 ] ) . toEqual ( new StackFrame ( 'dumpException3' , [ ] , 'http://path/to/file.js' , '52' ) ) ;
11- expect ( stackFrames [ 2 ] ) . toEqual ( new StackFrame ( 'onclick' , [ ] , 'http://path/to/file.js' , '82' ) ) ;
9+ expect ( stackFrames [ 0 ] ) . toMatchStackFrame ( [ undefined , undefined , 'http://path/to/file.js' , 48 ] ) ;
10+ expect ( stackFrames [ 1 ] ) . toMatchStackFrame ( [ 'dumpException3' , undefined , 'http://path/to/file.js' , 52 ] ) ;
11+ expect ( stackFrames [ 2 ] ) . toMatchStackFrame ( [ 'onclick' , undefined , 'http://path/to/file.js' , 82 ] ) ;
1212 } ) ;
1313
1414 it ( 'should parse Safari 7 Error.stack' , function ( ) {
1515 var stackFrames = unit . parse ( CapturedExceptions . SAFARI_7 ) ;
1616 expect ( stackFrames ) . toBeTruthy ( ) ;
1717 expect ( stackFrames . length ) . toBe ( 3 ) ;
18- expect ( stackFrames [ 0 ] ) . toEqual ( new StackFrame ( '' , [ ] , 'http://path/to/file.js' , '48' , '22' ) ) ;
19- expect ( stackFrames [ 1 ] ) . toEqual ( new StackFrame ( 'foo' , [ ] , 'http://path/to/file.js' , '52' , '15' ) ) ;
20- expect ( stackFrames [ 2 ] ) . toEqual ( new StackFrame ( 'bar' , [ ] , 'http://path/to/file.js' , ' 108' , ' 107' ) ) ;
18+ expect ( stackFrames [ 0 ] ) . toMatchStackFrame ( [ undefined , undefined , 'http://path/to/file.js' , 48 , 22 ] ) ;
19+ expect ( stackFrames [ 1 ] ) . toMatchStackFrame ( [ 'foo' , undefined , 'http://path/to/file.js' , 52 , 15 ] ) ;
20+ expect ( stackFrames [ 2 ] ) . toMatchStackFrame ( [ 'bar' , undefined , 'http://path/to/file.js' , 108 , 107 ] ) ;
2121 } ) ;
2222
2323 it ( 'should parse Firefox 31 Error.stack' , function ( ) {
2424 var stackFrames = unit . parse ( CapturedExceptions . FIREFOX_31 ) ;
2525 expect ( stackFrames ) . toBeTruthy ( ) ;
2626 expect ( stackFrames . length ) . toBe ( 2 ) ;
27- expect ( stackFrames [ 0 ] ) . toEqual ( new StackFrame ( 'foo' , [ ] , 'http://path/to/file.js' , '41' , '13' ) ) ;
28- expect ( stackFrames [ 1 ] ) . toEqual ( new StackFrame ( 'bar' , [ ] , 'http://path/to/file.js' , '1' , '1' ) ) ;
27+ expect ( stackFrames [ 0 ] ) . toMatchStackFrame ( [ 'foo' , undefined , 'http://path/to/file.js' , 41 , 13 ] ) ;
28+ expect ( stackFrames [ 1 ] ) . toMatchStackFrame ( [ 'bar' , undefined , 'http://path/to/file.js' , 1 , 1 ] ) ;
2929 } ) ;
3030
3131 it ( 'should parse V8 Error stacks' , function ( ) {
3232 var stackFrames = unit . parse ( CapturedExceptions . CHROME_15 ) ;
3333 expect ( stackFrames ) . toBeTruthy ( ) ;
3434 expect ( stackFrames . length ) . toBe ( 4 ) ;
35- expect ( stackFrames [ 0 ] ) . toEqual ( new StackFrame ( 'bar' , [ ] , 'http://path/to/file.js' , '13' , '17' ) ) ;
36- expect ( stackFrames [ 1 ] ) . toEqual ( new StackFrame ( 'bar' , [ ] , 'http://path/to/file.js' , '16' , '5' ) ) ;
37- expect ( stackFrames [ 2 ] ) . toEqual ( new StackFrame ( 'foo' , [ ] , 'http://path/to/file.js' , '20' , '5' ) ) ;
38- expect ( stackFrames [ 3 ] ) . toEqual ( new StackFrame ( '' , [ ] , 'http://path/to/file.js' , '24' , '4' ) ) ;
35+ expect ( stackFrames [ 0 ] ) . toMatchStackFrame ( [ 'bar' , undefined , 'http://path/to/file.js' , 13 , 17 ] ) ;
36+ expect ( stackFrames [ 1 ] ) . toMatchStackFrame ( [ 'bar' , undefined , 'http://path/to/file.js' , 16 , 5 ] ) ;
37+ expect ( stackFrames [ 2 ] ) . toMatchStackFrame ( [ 'foo' , undefined , 'http://path/to/file.js' , 20 , 5 ] ) ;
38+ expect ( stackFrames [ 3 ] ) . toMatchStackFrame ( [ undefined , undefined , 'http://path/to/file.js' , 24 , 4 ] ) ;
3939 } ) ;
4040
4141 it ( 'should parse IE 10 Error stacks' , function ( ) {
4242 var stackFrames = unit . parse ( CapturedExceptions . IE_10 ) ;
4343 expect ( stackFrames ) . toBeTruthy ( ) ;
4444 expect ( stackFrames . length ) . toBe ( 3 ) ;
45- expect ( stackFrames [ 0 ] ) . toEqual ( new StackFrame ( '' , [ ] , 'http://path/to/file.js' , '48' , '13' ) ) ;
46- expect ( stackFrames [ 1 ] ) . toEqual ( new StackFrame ( 'foo' , [ ] , 'http://path/to/file.js' , '46' , '9' ) ) ;
47- expect ( stackFrames [ 2 ] ) . toEqual ( new StackFrame ( 'bar' , [ ] , 'http://path/to/file.js' , '82' , '1' ) ) ;
45+ expect ( stackFrames [ 0 ] ) . toMatchStackFrame ( [ undefined , undefined , 'http://path/to/file.js' , 48 , 13 ] ) ;
46+ expect ( stackFrames [ 1 ] ) . toMatchStackFrame ( [ 'foo' , undefined , 'http://path/to/file.js' , 46 , 9 ] ) ;
47+ expect ( stackFrames [ 2 ] ) . toMatchStackFrame ( [ 'bar' , undefined , 'http://path/to/file.js' , 82 , 1 ] ) ;
4848 } ) ;
4949
5050 it ( 'should parse Opera 9.27 Error messages' , function ( ) {
5151 var stackFrames = unit . parse ( CapturedExceptions . OPERA_927 ) ;
5252 expect ( stackFrames ) . toBeTruthy ( ) ;
5353 expect ( stackFrames . length ) . toBe ( 3 ) ;
54- expect ( stackFrames [ 0 ] ) . toEqual ( new StackFrame ( 'bar' , [ ] , 'http://path/to/file.js' , '42' ) ) ;
55- expect ( stackFrames [ 1 ] ) . toEqual ( new StackFrame ( 'bar' , [ ] , 'http://path/to/file.js' , '27' ) ) ;
56- expect ( stackFrames [ 2 ] ) . toEqual ( new StackFrame ( 'foo' , [ ] , 'http://path/to/file.js' , '18' ) ) ;
54+ expect ( stackFrames [ 0 ] ) . toMatchStackFrame ( [ undefined , undefined , 'http://path/to/file.js' , 43 ] ) ;
55+ expect ( stackFrames [ 1 ] ) . toMatchStackFrame ( [ undefined , undefined , 'http://path/to/file.js' , 31 ] ) ;
56+ expect ( stackFrames [ 2 ] ) . toMatchStackFrame ( [ undefined , undefined , 'http://path/to/file.js' , 18 ] ) ;
5757 } ) ;
5858
5959 it ( 'should parse Opera 11 Error messages' , function ( ) {
6060 var stackFrames = unit . parse ( CapturedExceptions . OPERA_11 ) ;
6161 expect ( stackFrames ) . toBeTruthy ( ) ;
6262 expect ( stackFrames . length ) . toBe ( 4 ) ;
63- expect ( stackFrames [ 0 ] ) . toEqual ( new StackFrame ( 'run' , [ ] , 'http://path/to/file.js' , '27' ) ) ;
64- expect ( stackFrames [ 0 ] ) . toEqual ( new StackFrame ( 'bar' , [ ] , 'http://path/to/file.js' , '18' ) ) ;
65- expect ( stackFrames [ 1 ] ) . toEqual ( new StackFrame ( 'bar ', [ ] , 'http://path/to/file.js' , '11' ) ) ;
66- expect ( stackFrames [ 2 ] ) . toEqual ( new StackFrame ( '' , [ ] , 'http://path/to/file.js' , '15' ) ) ;
63+ expect ( stackFrames [ 0 ] ) . toMatchStackFrame ( [ 'run' , undefined , 'http://path/to/file.js' , 27 ] ) ;
64+ expect ( stackFrames [ 1 ] ) . toMatchStackFrame ( [ 'bar' , undefined , 'http://path/to/file.js' , 18 ] ) ;
65+ expect ( stackFrames [ 2 ] ) . toMatchStackFrame ( [ 'foo ', undefined , 'http://path/to/file.js' , 11 ] ) ;
66+ expect ( stackFrames [ 3 ] ) . toMatchStackFrame ( [ undefined , undefined , 'http://path/to/file.js' , 15 ] ) ;
6767 } ) ;
6868 } ) ;
6969} ) ;
0 commit comments