From 6791b1799e801ea550f106504f17002551613034 Mon Sep 17 00:00:00 2001 From: k-fish Date: Tue, 14 Sep 2021 16:00:16 -0400 Subject: [PATCH] ref(ember): Fix Qunit causing flake A recent update to QUnit (2.17) changed onUnhandledRejection to onUncaughtException. Ember try seems to be re-installing the latest qunit. This fix should make both sides of the QUnit change work. --- packages/ember/tests/helpers/setup-sentry.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/ember/tests/helpers/setup-sentry.js b/packages/ember/tests/helpers/setup-sentry.js index 034e7089f99f..28de02984f53 100644 --- a/packages/ember/tests/helpers/setup-sentry.js +++ b/packages/ember/tests/helpers/setup-sentry.js @@ -28,9 +28,13 @@ export function setupSentryTest(hooks) { this.fetchStub = sinon.stub(window, 'fetch'); /** - * Stops global test suite failures from unhandled rejections and allows assertion on them + * Stops global test suite failures from unhandled rejections and allows assertion on them. + * onUncaughtException is used in QUnit 2.17 onwards. */ - this.qunitOnUnhandledRejection = sinon.stub(QUnit, 'onUnhandledRejection'); + this.qunitOnUnhandledRejection = sinon.stub( + QUnit, + QUnit.onUncaughtException ? 'onUncaughtException' : 'onUnhandledRejection', + ); QUnit.onError = function({ message }) { errorMessages.push(message.split('Error: ')[1]);