Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(testing): do not throw on error.errors.map #12810

Merged
merged 1 commit into from Nov 20, 2021

Conversation

yacinehmito
Copy link
Contributor

In tests, the function to format errors would assume that any property errors on error would contain an array, which is not necessarily the case.

I am currently porting a library to Deno and I was just bit by this.

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this patch @yacinehmito! I think we just need to check for error being an AggregateError or possibly that error.errors instanceof Array

runtime/js/40_testing.js Outdated Show resolved Hide resolved
@yacinehmito yacinehmito force-pushed the fix-error-errors-map branch 2 times, most recently from 2609ad2 to 878a066 Compare November 20, 2021 12:55
@yacinehmito
Copy link
Contributor Author

Thank you for the review @dsherret.

In tests, the function to format errors would assume that any error with
a property `errors` would be an `AggregateError`, and therefore the
property `errors` would contain an error. This is not necessarily the
case.
Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @yacinehmito!

@dsherret dsherret merged commit 2dbc8fb into denoland:main Nov 20, 2021
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.

None yet

2 participants