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] Enforce top level describe #401

Closed
bodinsamuel opened this issue Aug 19, 2019 · 6 comments
Closed

[new-rule] Enforce top level describe #401

bodinsamuel opened this issue Aug 19, 2019 · 6 comments

Comments

@bodinsamuel
Copy link

@bodinsamuel bodinsamuel commented Aug 19, 2019

Hello everyone,

Jest, and most testing library, let you write and organise your tests as you want, which is good but it can become a mess with large testing codebase.
(Somewhat similar to #362 and no-standalone-expect )
It would be super cool to have a rule to enforce a top-level describe and make sure no test, it, beforeAll etc... can live outside this describe.
Maybe it can be something like:

  • require-top-level-describe
    or
  • merged with no-standalone-expect
    => no-standalone: ['error', ['test', 'hook', 'expect']]

What do you think?

@SimenB
Copy link
Member

@SimenB SimenB commented Aug 19, 2019

Sure, I'm down with that 🙂

@thomaslombart
Copy link

@thomaslombart thomaslombart commented Aug 29, 2019

Hi! That's something I was looking for as well and I would like to give it a try by opening a PR. Does it work for you? 🙂

@SimenB
Copy link
Member

@SimenB SimenB commented Aug 29, 2019

Go for it!

@bodinsamuel
Copy link
Author

@bodinsamuel bodinsamuel commented Aug 29, 2019

That would be awesome @thomlom 🙏

@SimenB
Copy link
Member

@SimenB SimenB commented Aug 29, 2019

🎉 This issue has been resolved in version 22.16.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@bodinsamuel
Copy link
Author

@bodinsamuel bodinsamuel commented Aug 30, 2019

Amazing, this is perfect. A big thanks to both of you 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants