You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We noticed that our test suite was passing, but unit tests were printing an error like this one:
build 18-Oct-2021 17:26:54 An error was thrown in a Promise outside a test. Did you forget to await a function or assertion?
build 18-Oct-2021 17:26:54 TypeError: Cannot read property 'getBoundingClientRect' of undefined
Upon further investigation, this revealed a real bug. We would like to consider these failures. Is there a good way to fail the tests based on uncaught promise resolutions at the test runner level?
I thought of a couple solutions:
pipe logs into grep
add an unhandled promise rejection listener to before before all test suites
But, I know there's already some mechanism for filtering logs and it seems like it might be possible to hook into it in a neat way.
I'm using mocha, if it makes a difference.
It seems like @LarsDenBakker wrote most of the logging stuff, so I'm curious to hear his opinion.
The text was updated successfully, but these errors were encountered:
Hi, thanks for the issue. Lars was on vacation the last time I checked with him. But this does seem like a bug.
Feel free to submit a PR if you would like to contribute, I can help with reviewing and merging it.
We noticed that our test suite was passing, but unit tests were printing an error like this one:
Upon further investigation, this revealed a real bug. We would like to consider these failures. Is there a good way to fail the tests based on uncaught promise resolutions at the test runner level?
I thought of a couple solutions:
before
before all test suitesBut, I know there's already some mechanism for filtering logs and it seems like it might be possible to hook into it in a neat way.
I'm using mocha, if it makes a difference.
It seems like @LarsDenBakker wrote most of the logging stuff, so I'm curious to hear his opinion.
The text was updated successfully, but these errors were encountered: