Skip to content

Address error in tap reporter when originalError is undefined#3325

Closed
evmiguel wants to merge 1 commit into
avajs:mainfrom
evmiguel:tap-original-error
Closed

Address error in tap reporter when originalError is undefined#3325
evmiguel wants to merge 1 commit into
avajs:mainfrom
evmiguel:tap-original-error

Conversation

@evmiguel

Copy link
Copy Markdown

This is a follow up from the discussion in #3322. The tap reporter was failing when ava timed out because of

originalError.name = name; // Restore the original name.

being undefined.

The suggestion was to use optional chaining on the left side of the assignment, but I ran into the tests failing, so I wrapped the assignment in an if condition.

@novemberborn

Copy link
Copy Markdown
Member

The suggestion was to use optional chaining on the left side of the assignment, but I ran into the tests failing, so I wrapped the assignment in an if condition.

Yes that's my bad, you can't use optional chaining on the left hand side in an assignment.

@novemberborn novemberborn marked this pull request as ready for review May 5, 2024 19:56
@novemberborn novemberborn marked this pull request as draft May 5, 2024 19:57
@novemberborn

Copy link
Copy Markdown
Member

@evmiguel looking at the rest of the function, the originalError.stack assignment would also fail.

Looking at how dumpError is called, I don't see how it would be called with an undefined value. Could you provide a reproduction of the error?

@novemberborn

Copy link
Copy Markdown
Member

Closing due to inactivity. We'd be happy to pick this up again when you have the time to get back to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants