Skip to content

Commit

Permalink
ref(ember): Fix Qunit causing flake
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
k-fish authored and kamilogorek committed Sep 15, 2021
1 parent c8a941c commit 6791b17
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/ember/tests/helpers/setup-sentry.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 6791b17

Please sign in to comment.