Skip to content

await-async-events doesn't seem to check calls from user sessions returned by userEvent.setup() #812

Open
@julienw

Description

@julienw

What rule do you want to change?

await-async-events

Does this change cause the rule to produce more or fewer warnings?

More warnings

How will the change be implemented?

The code needs to detect calls to userEvent.setup() and calls to the resulting object's methods.

Example code

import userEvent from '@testing-library/user-event';
const user = userEvent.setup();
user.click(domElement);

How does the current rule affect the code?

user.click() and others returns a Promise and should be awaited.

How will the new rule affect the code?

import userEvent from '@testing-library/user-event';
const user = userEvent.setup();
await user.click(domElement);

Anything else?

see also #800

Do you want to submit a pull request to change the rule?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions