-
Notifications
You must be signed in to change notification settings - Fork 781
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
Add a config option for unhandledrejection behavior #1419
Comments
I'm definitely sympathetic to your situation, but I don't think we should have divergent behavior (between FWIW, as a work around while you work on fixing your test suite you should be able to do something like: const KNOWN_REJECTIONS = [
// list of known rejections in your test suite
// as issues are fixed, you should remove entries
// from this array
//
// the goal here is to ensure that no **knew** unhandled
// rejections get added to the test suite, while the existing
// ones are whittled away
];
const ORIG_QUNIT_UNHANDLED_REJECTION = QUnit.onUnhandledRejection;
QUnit.onUnhandledRejection = function(reason) {
if (KNOWN_REJECTIONS.indexOf(reason.message) > -1) {
// do nothing
} else {
return ORIG_QUNIT_UNHANDLED_REJECTION.call(QUnit, reason);
}
}; This works because QUnit sets up a handler for the event that calls the Lines 1059 to 1061 in d7f1e27
|
No problem. Thanks for the workaround suggestion! |
properties on |
I have a large codebase with tests written with QUnit 1. While upgrading, a lot of them fail with QUnit 2.5 because it started considering unhandled rejections errors.
I can probably find a way to work around this, but I was wondering if the QUnit project would support a config option to go back to the old way of allowing unhandled rejections?
The text was updated successfully, but these errors were encountered: