-
-
Notifications
You must be signed in to change notification settings - Fork 306
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
add message defaults to .ok() and .notOk() #261
Conversation
@@ -312,7 +312,7 @@ Test.prototype.notOk | |||
= Test.prototype.notok | |||
= function (value, msg, extra) { | |||
this._assert(!value, { | |||
message : msg, | |||
message : defined(msg, 'should be falsey'), |
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.
nit: falsy
shouldn't have an e
imo.
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.
also i don't see any tests covering the falsy case
@ljharb ok, updated to |
@paulcpederson that's the conclusion i would also come to. would you mind adding some? fwiw I really like this change - it doesn't change the API, just makes two of the assertions more useful by default. |
cool. I think I can figure out how to do that. |
@ljharb ok I added a new test that just tests all of the defaults. Sorry that took me a bit to figure out the test structure. Testing a testing framework is very meta. |
Awesome, this LGTM as a semver-minor change. Any other collaborators object? If not, I'll merge this in a day or two. |
@ljharb bump. Have any other collaborators taken a look? |
Thanks for the bump - I'll merge this today or tomorrow. |
@paulcpederson actually would you mind rebasing this on the latest master? |
Not at all. |
Thanks, ping me when it's updated and I'll merge it! |
@ljharb ok, should be rebased now from |
Just noticed in a reporter that there are really nice test defaults for methods like
.equals
, but.ok()
and.notOk()
just say(unnamed assert)
.This adds the following default messages:
.ok()
- "should be truthy".notOk()
- "should be falsey"Also updates the tests where they are expecting the old default value.