Skip to content

[new-rule] Enforce top level describe #401

@bodinsamuel

Description

@bodinsamuel

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions