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

Rule proposal: test-title-format #157

Closed
alexander-akait opened this issue Nov 17, 2016 · 11 comments · Fixed by #235
Closed

Rule proposal: test-title-format #157

alexander-akait opened this issue Nov 17, 2016 · 11 comments · Fixed by #235
Labels
enhancement 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt help wanted

Comments

@alexander-akait
Copy link

alexander-akait commented Nov 17, 2016

Issuehunt badges

Give to check the title on a specific regex pattern.
We adhere to specific naming titles, but the new members in the team are sometimes overlooked or do mistake.

IssueHunt Summary

gmartigny gmartigny has been rewarded.

Sponsors (Total: $60.00)

Tips

@sindresorhus
Copy link
Member

Sounds like a good idea. Would you mind providing some examples of the test titles you use?

@alexander-akait
Copy link
Author

alexander-akait commented Nov 17, 2016

@sindresorhus
All our test starting at should succeed when (if, for) ..., should fail when (if, for), should throw exception when (if, for) ..., ``should not throw exception when (if, for) ...` and etc.

@jfmengels
Copy link
Contributor

FYI, eslint-plugin-mocha has similar rules: valid-test-description and valid-suite-description.

Sounds good to me too.

@sindresorhus
Copy link
Member

What kind of regex would you use? Should it also support hooks?

@alexander-akait
Copy link
Author

@sindresorhus ^should (pass|fail|(not)?\sthrow)\s.+$

@jfmengels
Copy link
Contributor

I'm guessing that if you pass a regex to the rule's options (only possible when you configure your lint file in JS), we'll use it as is, but if you pass a string, we'll transform it with new Regex, meaning you'll probably need to use espacing in your regex, like ^should (pass|fail|(not)?\\sthrow)\\s.+$

@alexander-akait
Copy link
Author

@jfmengels sgtm for me

@sindresorhus
Copy link
Member

sindresorhus commented Nov 18, 2016

Sounds good. Pull request welcome :)


Alternative rule name suggestions:

  • valid-test-title
  • test-title-style
  • test-title-format

@jfmengels
Copy link
Contributor

I like test-title-format.

@sindresorhus sindresorhus changed the title Rule proposal: test-title-pattern Rule proposal: test-title-format Nov 18, 2016
@IssueHuntBot
Copy link

@IssueHunt has funded $60.00 to this issue.


GMartigny added a commit to GMartigny/eslint-plugin-ava that referenced this issue Apr 22, 2019
@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label May 10, 2019
@issuehunt-oss issuehunt-oss bot added 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt and removed 💵 Funded on Issuehunt This issue has been funded on Issuehunt labels May 27, 2019
@IssueHuntBot
Copy link

@sindresorhus has rewarded $54.00 to @GMartigny. See it on IssueHunt

  • 💰 Total deposit: $60.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $6.00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants