Skip to content
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

New rule: avoid-prefixing-tests-with #273

Closed
G-Rath opened this issue May 31, 2019 · 4 comments
Closed

New rule: avoid-prefixing-tests-with #273

G-Rath opened this issue May 31, 2019 · 4 comments

Comments

@G-Rath
Copy link
Collaborator

G-Rath commented May 31, 2019

Basically, this would catch things like it('it should throw an error', () => { ...

I figure it would be best as a more generic rule, that took a list of strings that should be considered as undesired to have at the start of the messages for test calls, with "it" being the default.

(The rule name could be improved :/)

@ranyitz
Copy link
Contributor

ranyitz commented Jun 2, 2019

It would also help if you want to remove an accidental space:

it(' should remove space in the beginning', () => { ...

I think that adding a rule like that which is fixable (removes the unwanted string) would be nice.

@SimenB
Copy link
Member

SimenB commented Jun 3, 2019

Sure, PR welcome! 👍

@G-Rath G-Rath self-assigned this Aug 4, 2019
@suganya-sangith
Copy link
Contributor

Shall I start working on it?

@G-Rath
Copy link
Collaborator Author

G-Rath commented Oct 5, 2019

@suganya-sangith if you've got the time, go for it! I'd love to see this rule, but haven't had the time to finish off my implementation.

Feel free to tag me in the PR, and I'll review it 🙂

Name-wise, I think valid-title is a decent one to go w/, as it'll let us re-use the rule to cover checking titles for a number of different things.

suganya-sangith pushed a commit to suganya-sangith/eslint-plugin-jest that referenced this issue Oct 17, 2019
suganya-sangith pushed a commit to suganya-sangith/eslint-plugin-jest that referenced this issue Oct 17, 2019
suganya-sangith pushed a commit to suganya-sangith/eslint-plugin-jest that referenced this issue Oct 18, 2019
suganya-sangith pushed a commit to suganya-sangith/eslint-plugin-jest that referenced this issue Oct 18, 2019
suganya-sangith pushed a commit to suganya-sangith/eslint-plugin-jest that referenced this issue Oct 18, 2019
@G-Rath G-Rath closed this as completed Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants