Skip to content

Can't use 'expect' in a 'catch' block of a testWidgets() body #4662

@Hixie

Description

@Hixie

If runApp() throws synchronously, things end up such that you can't catch the exception and call expect() (because the whenComplete block in guard() hasn't run yet?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: tests"flutter test", flutter_test, or one of our testsc: crashStack traces logged to the consoleframeworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions