-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
test: fix ineffective error tests #27333
Conversation
Fix tests whether errors are thrown correctly because they are successful when error doesn't get thrown.
aa46727
to
52fb259
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM while I would prefer to use assert.throws(fn, errorFunction)
(or assert.rejects()
for promises) instead of try / catch
in combination with threw
or assert.fail()
. That way each test is nicely encapsulated.
3d63790
to
c862bd1
Compare
c862bd1
to
823bfbe
Compare
@BridgeAR Thank you for your review. I fix this PR to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still LGTM. Thanks for following up on the suggestions.
Landed in fb3f600. |
Thanks for doing this! =) |
Fix tests whether errors are thrown correctly
because they are successful when error doesn't get thrown.
fix #26385
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes