Skip to content

Add lint to warn against using await outside of test/setUp functions #2593

Description

@b-luk

Having an await in the main() function outside of test/setUp functions can cause a race condition sometimes resulting in an "Bad state: Can't call test() once tests have begun running." error.

It would be nice to have a lint for this.

See flutter/flutter#182306 for an example of us encountering/fixing this issue in a test.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions