-
-
Notifications
You must be signed in to change notification settings - Fork 697
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
Expect allows "empty" assertions #940
Comments
@Weeknie Thanks for reaching out. I'm going to close this issue simply because it's a duplicate of existing issues, but please feel free to jump in on the discussion in #726. Another issue worth reading is #94. The short answer is that some of the problems such as typos can be easily fixed (and already are in v4 available via |
When defining assertions, there seems to be no error thrown if the final word in the chain doesn't define an actual assertion. E.g.
expect(42).to.be.cthulu
doesn't seem to do anything, it will simply silently disappear into the night.Whenever someone starts a line with expect(), you can be certain it's supposed to be an assertion, so if by the end of the statement no assertion has been defined, shouldn't this throw some kind of unexpected error?
I am rather new to chai, so if there's a specific reason for this or this is hard to implement, you'll have to forgive me :) I mostly suggest fixing behavior because it helps to detect typos or wrongly assumed assertion names (I tried debugging chai-as-promised's
expect(promise).resolved
for an hour before figuring out it was supposed to beexpect(promise).fulfilled
The text was updated successfully, but these errors were encountered: