Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle unintentional floating promises #4947

Merged
merged 1 commit into from
Oct 8, 2022

Conversation

merceyz
Copy link
Member

@merceyz merceyz commented Oct 8, 2022

What's the problem this PR addresses?

There are promises in the codebase (mostly in tests) that aren't awaited when they should be.

Hopefully solves the Jest did not exit one second after the test run has completed. from nodejs/citgm#905 (comment).

How did you fix it?

await the promise or change to the sync version if possible.

Checklist

  • I have read the Contributing Guide.
  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@SimenB
Copy link

SimenB commented Oct 8, 2022

@arcanis arcanis merged commit bb8fe0a into master Oct 8, 2022
@arcanis arcanis deleted the merceyz/fix/no-floating-promises branch October 8, 2022 15:41
@merceyz
Copy link
Member Author

merceyz commented Oct 8, 2022

@SimenB Probably, in this case I found them with https://typescript-eslint.io/rules/no-floating-promises/ but didn't commit it for now.

@SimenB
Copy link

SimenB commented Oct 8, 2022

FWIW, the jest rule doesn't require type information (which doesn't really work in monorepos). It won't catch as many cases, but it would catch all the resolves ones at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants