-
Notifications
You must be signed in to change notification settings - Fork 780
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
Handle expect(0) as expected #158
Conversation
…se a test to fail
@@ -122,7 +122,7 @@ Test.prototype = { | |||
} | |||
}, | |||
finish: function() { | |||
if ( this.expected && this.expected != this.assertions.length ) { | |||
if (this.expected !== undefined && this.expected !== null && this.expected != this.assertions.length ) { |
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.
You could do this.expected != null
to simplify this. Also please keep the whitespace intact (missing space after opening paren).
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.
Done and done. Thanks for the heads up.
We should also add unit tests for these two cases:
|
Writing the first test is easy but I don't think it would be good to have a test case that purposely fails. Actually we should test The second case would also pass without my changes. Maybe the following argument will suffice to pull in these changes:
|
The suggested change to have |
Landed! |
I think that if something like the following fails
then the following should fail too