In the official documentation, there is an example of mutation testing (link to example). One of the assertions checks if the loading state is present in the DOM. This example uses user-event
(GitHub link). According to the documentation, these events are asynchronous, but in this example, there is no await
before firing the click event.
In my code, I use the await-async-events
ESLint plugin, which enforces the use of await
before asynchronous events (documentation link). Could you please explain this inconsistency? How should I handle it?
Currently, I work around this by adding the following comment before user-event
calls:
// eslint-disable-next-line testing-library/await-async-events