-
Notifications
You must be signed in to change notification settings - Fork 49
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 assertion-arguments
rule (fixes #92)
#95
Conversation
|
||
## Options | ||
|
||
The rule takes one option, a string, which could be either `"always"` (enforces error messages) or `"never"` (forbids assertion messages). If omitted or set to false, assertion messages will be neither enforced nor forbidden. |
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.
It no longer makes sense to have this as a main boolean option. I think it should rather be part of an options object.
Maybe we should also ensure the message argument is a string? I know you could potentially put it in an external string, but most put it inline, so we could just de-opt on non-literal values. Or maybe even use code paths as if it's not inline, it's always in the same file. Could be a follow up tweak. Just want your opinion. |
Yeah, I was thinking the same thing, and also checking that If we need to play with code paths, I'd rather put it as a follow-up tweak, still can't figure my head around it ^^' |
8870fea
to
e6ad8c8
Compare
Updated |
t.true(array.indexOf(value) !== -1); | ||
}); | ||
|
||
/* eslint ava/assertion-arguments: ["error", "never"] */ |
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.
These comments needs to be updated with the new format.
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.
Ugh... yes.
e6ad8c8
to
513503d
Compare
513503d
to
23fad11
Compare
Updated |
Splendid work as always @jfmengels 🙌 |
Hey, a DiCaprio gif, it's been a while :D |
I recently stocked up on more of those. |
Add
assertion-arguments
rule (fixes #92)Willing to change the name of the rule, but this is pretty generic, and maybe some day we'll want to detect the argument types.
Probably to be followed by the deprecation of
assertion-message
.