eslint-plugin-testing-library icon indicating copy to clipboard operation
eslint-plugin-testing-library copied to clipboard

`no-wait-for-empty-callback`: report empty `Promise.resolve()`

Open MichaelDeBoey opened this issue 4 years ago • 2 comments

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.

MichaelDeBoey avatar May 04 '21 11:05 MichaelDeBoey

Agreed

kentcdodds avatar May 04 '21 13:05 kentcdodds

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.

stale[bot] avatar Jul 13 '21 23:07 stale[bot]

no-wait-for-empty-callback was removed in v6. Should it be closed?

Semigradsky avatar Sep 22 '23 11:09 Semigradsky

@Semigradsky Good catch! Thanks for pointing it out.

Belco90 avatar Sep 26 '23 10:09 Belco90