@@ -5,7 +5,6 @@ describe('stacktrace', () => {
55 it ( 'should parse Chrome/V8 stack trace format with function names' , ( ) => {
66 const error = {
77 stack : `Error: test error
8- at captureStackTrace (http://example.com/stacktrace.js:1:1)
98 at myFunction (http://example.com/app.js:42:10)
109 at anotherFunction (http://example.com/app.js:100:5)` ,
1110 } as Error
@@ -31,7 +30,6 @@ describe('stacktrace', () => {
3130 it ( 'should parse Chrome/V8 stack trace format without function names' , ( ) => {
3231 const error = {
3332 stack : `Error: test error
34- at captureStackTrace (http://example.com/stacktrace.js:1:1)
3533 at http://example.com/app.js:42:10
3634 at http://example.com/app.js:100:5` ,
3735 } as Error
@@ -57,7 +55,6 @@ describe('stacktrace', () => {
5755 it ( 'should parse Firefox stack trace format' , ( ) => {
5856 const error = {
5957 stack : `test error
60- captureStackTrace@http://example.com/stacktrace.js:1:1
6158myFunction@http://example.com/app.js:42:10
6259anotherFunction@http://example.com/app.js:100:5` ,
6360 } as Error
@@ -83,7 +80,6 @@ anotherFunction@http://example.com/app.js:100:5`,
8380 it ( 'should skip frames when skipFrames is specified' , ( ) => {
8481 const error = {
8582 stack : `Error: test error
86- at captureStackTrace (http://example.com/stacktrace.js:1:1)
8783 at frameToSkip (http://example.com/app.js:10:5)
8884 at myFunction (http://example.com/app.js:42:10)
8985 at anotherFunction (http://example.com/app.js:100:5)` ,
@@ -126,7 +122,6 @@ anotherFunction@http://example.com/app.js:100:5`,
126122 it ( 'should skip malformed stack lines' , ( ) => {
127123 const error = {
128124 stack : `Error: test error
129- at captureStackTrace (http://example.com/stacktrace.js:1:1)
130125 at myFunction (http://example.com/app.js:42:10)
131126 some malformed line without proper format
132127 at anotherFunction (http://example.com/app.js:100:5)` ,
@@ -153,7 +148,6 @@ anotherFunction@http://example.com/app.js:100:5`,
153148 it ( 'should handle file paths with spaces' , ( ) => {
154149 const error = {
155150 stack : `Error: test error
156- at captureStackTrace (http://example.com/stacktrace.js:1:1)
157151 at myFunction (http://example.com/my app.js:42:10)` ,
158152 } as Error
159153
@@ -168,25 +162,6 @@ anotherFunction@http://example.com/app.js:100:5`,
168162 } ,
169163 ] )
170164 } )
171-
172- it ( 'should trim whitespace from function and file names' , ( ) => {
173- const error = {
174- stack : `Error: test error
175- at captureStackTrace (http://example.com/stacktrace.js:1:1)
176- at myFunction ( http://example.com/app.js :42:10)` ,
177- } as Error
178-
179- const result = parseStackTrace ( error )
180-
181- expect ( result ) . toEqual ( [
182- {
183- fileName : 'http://example.com/app.js' ,
184- function : 'myFunction' ,
185- lineNumber : 42 ,
186- columnNumber : 10 ,
187- } ,
188- ] )
189- } )
190165 } )
191166
192167 describe ( 'captureStackTrace' , ( ) => {
@@ -205,16 +180,16 @@ anotherFunction@http://example.com/app.js:100:5`,
205180 } )
206181
207182 it ( 'should skip frames when specified' , ( ) => {
208- function testFunction ( ) {
209- return captureStackTrace ( 0 )
183+ function testFunction ( skipFrames = 0 ) {
184+ return captureStackTrace ( skipFrames )
210185 }
211186
212187 function wrapperFunction ( ) {
213188 return testFunction ( )
214189 }
215190
216191 const resultWithoutSkip = wrapperFunction ( )
217- const resultWithSkip = captureStackTrace ( 1 )
192+ const resultWithSkip = testFunction ( 1 )
218193
219194 // When skipping frames, we should have fewer frames
220195 expect ( resultWithSkip . length ) . toBeLessThan ( resultWithoutSkip . length )
0 commit comments