Skip to content

FR Rule: Prevent snapshot inside wait #214

Closed
@SBoudrias

Description

@SBoudrias

I wonder if there'd be a way to make sure there's no snapshot done inside wait conditions.

Example invalid usage:

await wait(() => {
  expect(foo).toMatchSnapshot();
});

Valid:

expect(foo).toMatchSnapshot();

This is between jest and and testing-library, but the depreciated wait() functions allow tests like this to be written and lead to flakey cases.

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