Skip to content

[expect-expect] reports the entire test as erroneous #539

@DanielSWolf

Description

@DanielSWolf

Within each unit test, the actual expect statement usually follows some amount of setup. As long as I'm writing this setup code, the test is technically invalid according to the expect-expect rule because it doesn't include any expects. However, this means that about 80% of the time I spend writing unit tests, the entire function I'm writing is disfigured with red squigglies:

image

This doesn't just look bad. It also hides any actual errors I may have made. Only when I type the first expect do I see whether there are any other problems with my code.

Would it be possible for this rule to report only part of the test function as erroneous? For instance, just the it? Here's a mockup of how this might look:

image

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