File tree 2 files changed +36
-0
lines changed
2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -230,5 +230,13 @@ describe('ErrorStackParser', function() {
230
230
expect ( stackframes [ 0 ] . lineNumber ) . toBe ( 2 ) ;
231
231
expect ( stackframes [ 0 ] . columnNumber ) . toBe ( 9 ) ;
232
232
} ) ;
233
+
234
+ it ( 'should handle parentheses in Node.js stacks' , function ( ) {
235
+ var stackframes = unit . parse ( CapturedExceptions . NODE_WITH_PARENTHESES ) ;
236
+ expect ( stackframes . length ) . toBe ( 7 ) ;
237
+ expect ( stackframes [ 0 ] . fileName ) . toEqual ( '/var/app/scratch/my project (top secret)/index.js' ) ;
238
+ expect ( stackframes [ 0 ] . lineNumber ) . toBe ( 2 ) ;
239
+ expect ( stackframes [ 0 ] . columnNumber ) . toBe ( 9 ) ;
240
+ } ) ;
233
241
} ) ;
234
242
} ) ;
Original file line number Diff line number Diff line change @@ -397,3 +397,31 @@ CapturedExceptions.NODE_WITH_SPACES = {
397
397
'Function.Module.runMain (internal/modules/cjs/loader.js:837:10)\n at ' +
398
398
'internal/main/run_main_module.js:17:11'
399
399
} ;
400
+
401
+ CapturedExceptions . NODE_WITH_SPACES = {
402
+ name : 'Error' ,
403
+ message : '' ,
404
+ stack : 'Error\n at Object.<anonymous> ' +
405
+ '(/var/app/scratch/my ' +
406
+ 'project/index.js:2:9)\n at Module._compile ' +
407
+ '(internal/modules/cjs/loader.js:774:30)\n at ' +
408
+ 'Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)\n ' +
409
+ ' at Module.load (internal/modules/cjs/loader.js:641:32)\n at ' +
410
+ 'Function.Module._load (internal/modules/cjs/loader.js:556:12)\n at ' +
411
+ 'Function.Module.runMain (internal/modules/cjs/loader.js:837:10)\n at ' +
412
+ 'internal/main/run_main_module.js:17:11'
413
+ } ;
414
+
415
+ CapturedExceptions . NODE_WITH_PARENTHESES = {
416
+ name : 'Error' ,
417
+ message : '' ,
418
+ stack : 'Error\n at Object.<anonymous> ' +
419
+ '(/var/app/scratch/my ' +
420
+ 'project (top secret)/index.js:2:9)\n at Module._compile ' +
421
+ '(internal/modules/cjs/loader.js:774:30)\n at ' +
422
+ 'Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)\n ' +
423
+ ' at Module.load (internal/modules/cjs/loader.js:641:32)\n at ' +
424
+ 'Function.Module._load (internal/modules/cjs/loader.js:556:12)\n at ' +
425
+ 'Function.Module.runMain (internal/modules/cjs/loader.js:837:10)\n at ' +
426
+ 'internal/main/run_main_module.js:17:11'
427
+ } ;
You can’t perform that action at this time.
0 commit comments