Skip to content

Commit

Permalink
test:added new key for node error when function name isn't there
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksey28 committed Oct 7, 2021
1 parent d74fe21 commit 2bd8aa1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion spec/error-stack-parser-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,13 @@ describe('ErrorStackParser', function() {

it('should handle spaces in Node.js stacks', function() {
var stackframes = unit.parse(CapturedExceptions.NODE_WITH_SPACES);
expect(stackframes.length).toBe(7);
expect(stackframes.length).toBe(8);
expect(stackframes[0].fileName).toEqual('/var/app/scratch/my project/index.js');
expect(stackframes[0].lineNumber).toBe(2);
expect(stackframes[0].columnNumber).toBe(9);
expect(stackframes[1].fileName).toEqual('/var/app/scratch/my project/index.js');
expect(stackframes[1].lineNumber).toBe(2);
expect(stackframes[1].columnNumber).toBe(9);
});
});
});
3 changes: 2 additions & 1 deletion spec/fixtures/captured-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,8 @@ CapturedExceptions.EDGE_20_NESTED_EVAL = {
CapturedExceptions.NODE_WITH_SPACES = {
name: 'Error',
message: '',
stack: 'Error\n at Object.<anonymous> ' +
stack: 'Error\n at /var/app/scratch/my '+
'project/index.js:2:9\n at Object.<anonymous> ' +
'(/var/app/scratch/my ' +
'project/index.js:2:9)\n at Module._compile ' +
'(internal/modules/cjs/loader.js:774:30)\n at ' +
Expand Down

0 comments on commit 2bd8aa1

Please sign in to comment.