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

BREAKING(testing): Renaming assertThrowsAsync to assertRejects #1101

Merged
merged 5 commits into from
Aug 9, 2021

Conversation

getspooky
Copy link
Contributor

The name assertThrowsAsync is overly long and verbose, yet it doesn't describe what it actually asserts which is that a promise rejects. Rename assertThrowsAsync -> assertRejects.

Please see: #1073

Copy link
Contributor

@caspervonb caspervonb left a comment

Choose a reason for hiding this comment

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

You'd have to apply this to all modules in the entire std library for the tests to pass.

But this hasn't been discussed yet, as you can see in the unlabelled issue you linked.

Probably the way we'd want to go forward is to keep exporting the old alias with deprecated annotations for a couple of releases as this is used a lot on the wild, including in CLI unit tests.

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

I agree with Casper, also I'd suggest to replace all usages of assertThrowsAsync in the code in this PR

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

LGTM

@getspooky getspooky requested a review from bartlomieju August 8, 2021 18:38
@kt3k
Copy link
Member

kt3k commented Aug 9, 2021

@getspooky Thank you for your contribution!

@caspervonb Thank you for the original suggestion!

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.

4 participants