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

test: catch and fail on uncaught exceptions and rejections #1599

Open
fryorcraken opened this issue Sep 22, 2023 · 3 comments
Open

test: catch and fail on uncaught exceptions and rejections #1599

fryorcraken opened this issue Sep 22, 2023 · 3 comments
Labels
bug Something isn't working E:Comprehensive dev testing See https://github.com/waku-org/pm/issues/90 for details good first issue Good for newcomers test Issue related to the test suite with no expected consequence to production code

Comments

@fryorcraken
Copy link
Collaborator

This is a bug report/feature or change request/support request

Problem

uncaughtException and unhandledRejection can happen when an exception is thrown or a promise rejects in an internal process not directly instantiated and caught by the user.

See #1584 (comment)

Proposed Solutions

Ensure that no such occurrence happens when running js-test by listening for these NodeJS event for all tests and failing them if one is caught.

Notes

@fryorcraken fryorcraken added test Issue related to the test suite with no expected consequence to production code E:Comprehensive dev testing See https://github.com/waku-org/pm/issues/90 for details labels Sep 22, 2023
@danisharora099 danisharora099 added the bug Something isn't working label Oct 17, 2023
@danisharora099
Copy link
Collaborator

ensure all async operations are "caught"/handled
perhaps can find some rule in eslint around the same

ideal to have a wide net sort of an approach

@danisharora099
Copy link
Collaborator

@weboko and @danisharora099 to look into possible solutions

@fryorcraken
Copy link
Collaborator Author

perhaps can find some rule in eslint around the same

Here we go: https://typescript-eslint.io/rules/no-floating-promises/ that would be a good start

@fryorcraken fryorcraken added the good first issue Good for newcomers label Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working E:Comprehensive dev testing See https://github.com/waku-org/pm/issues/90 for details good first issue Good for newcomers test Issue related to the test suite with no expected consequence to production code
Projects
Status: To Do
Development

No branches or pull requests

2 participants