Skip to content

new rule: no-side-effects-wait-for #134

@renatoagds

Description

@renatoagds

Following the proposed for Kent at his post (https://kentcdodds.com/blog/common-mistakes-with-react-testing-library). I would like to suggest a new rule that detects side effects inside a wait-for:

 // wrong await waitFor(() => { fireEvent.click(a) expect(b).toEqual('b') })
 // correct fireEvent.click(a) await waitFor(() => expect(b).toEqual('b'))

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions