-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[valid-title] Allow types that yield string for test titles #1234
Comments
Also allow const title = "should yield true"
it(title, () => {...}) // error will error out |
I'm pretty lukewarm on this - tbh I'm not really sure having Titles have two purposes:
By not using a string literal, you halve the effectiveness of having the title since it's a lot harder to find tests by their name alone. Meanwhile, you can already control where this rule is applied both via eslint config and inline disables which imo is better as its more explicit that you intended to use this pattern. As such, I don't think its worth the extra complexity to use typechecking in this rule, but because we already have |
🎉 This issue has been resolved in version 27.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Right now there is ability to
{ ignoreTypeOfDescribeName: true }
that ignores any type whether its anumber
or afunction
.How about we have a rule that restricts everything that does not yield type
typeof {title} === 'string'
. Or allows only the things that yield a string title.Why?
Because a lot of codebases use
action_types
,enums
,consts
, etc.Right now:
The text was updated successfully, but these errors were encountered: