-
Notifications
You must be signed in to change notification settings - Fork 1.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
Experimentally disable null expectations for throws assertions #2576
Conversation
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.
Thanks for picking this up @JSimoni42!
@@ -87,20 +87,29 @@ function getErrorWithLongStackTrace() { | |||
return err; | |||
} | |||
|
|||
function validateExpectations(assertion, expectations, numberArgs) { // eslint-disable-line complexity | |||
if (numberArgs === 1 || expectations === null || expectations === undefined) { |
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.
I think it'll be better if we keep this clause, but then before assigning expectations = {}
we check experiments.disableNullExpectations && expectations === null
. It's OK to duplicate the code to throw the assertion error.
The easier it is to understand the experimental logic, the easier to upgrade the codebase to make it the default logic.
Awesome. What's left now is to update the documentation:
In both those places it says you need to specify
|
@novemberborn Documentation has been updated. I noticed that #2575 was also failing checks due to the same test error in |
Should be fine now… |
Thanks @JSimoni42! |
Aims to fix #2410