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
Which environment are you using? (e.g., browser, Node): Node v14.15.4
How are you running QUnit? (e.g., script, testem, Grunt): npm test where test is qunit test.js
What are you trying to do?
I want to assert on objects that may contain cycles. This works OK when an assert passes, but when it fails it ends up killing the run due to an unhandled rejection. Most likely the cause is qunitjs/js-reporters#104. When the run dies due to unhandled rejection then QUnit.done is never called.
I expect the assertion to fail, and the test to fail. Afterward I expect QUnit.done to be called.
What actually happened?
The assert and test fail but QUnit.done is never called because an unhandled rejection takes place. This is important to me because I need to run some teardown/cleanup code otherwise my process will keep node's event loop busy. I'm doing this cleanup in QUnit.done but since it isn't being called my process stays alive.
The interval will never be cleared and so the process will "Ping-pong." forever. Should I be handling this kind of lifecycle another way? My current workaround is to handle the rejection myself:
Thanks, this should be fixed once we cut a js-reporters release for the TapReporter fix indeed. It might take a few weeks as there's a couple of other things that need to change in js-reporters before we can do another release there.
Tell us about your runtime:
npm test
wheretest
isqunit test.js
What are you trying to do?
I want to assert on objects that may contain cycles. This works OK when an assert passes, but when it fails it ends up killing the run due to an unhandled rejection. Most likely the cause is qunitjs/js-reporters#104. When the run dies due to unhandled rejection then
QUnit.done
is never called.QUnit.done
expected behavior?Code that reproduces the problem:
What did you expect to happen?
I expect the assertion to fail, and the test to fail. Afterward I expect
QUnit.done
to be called.What actually happened?
The assert and test fail but
QUnit.done
is never called because an unhandled rejection takes place. This is important to me because I need to run some teardown/cleanup code otherwise my process will keep node's event loop busy. I'm doing this cleanup inQUnit.done
but since it isn't being called my process stays alive.Consider a situation like this:
The interval will never be cleared and so the process will "Ping-pong." forever. Should I be handling this kind of lifecycle another way? My current workaround is to handle the rejection myself:
The text was updated successfully, but these errors were encountered: