eslint-plugin-testing-library
eslint-plugin-testing-library copied to clipboard
`no-wait-for-empty-callback`: report empty `Promise.resolve()`
I think that await waitFor(() => Promise.resolve()) should be reported by no-wait-for-empty-callback too.
I know @kentcdodds showed an alternative to wait for a mocked promise and in theory we could rewrite the act(() => promise) call in his example as await waitFor(() => promise).
This example is only valid because there's no visual feedback to wait for, but most of the times there is.
My proposition is to also report an empty Promise.resolve() and people could disable the rule deliberately when it's not possible to wait for visual feedback.
Agreed
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
no-wait-for-empty-callback was removed in v6. Should it be closed?
@Semigradsky Good catch! Thanks for pointing it out.