Skip to content

Commit 6791b17

Browse files
k-fishkamilogorek
authored andcommitted
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.
1 parent c8a941c commit 6791b17

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/ember/tests/helpers/setup-sentry.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ export function setupSentryTest(hooks) {
2828
this.fetchStub = sinon.stub(window, 'fetch');
2929

3030
/**
31-
* Stops global test suite failures from unhandled rejections and allows assertion on them
31+
* Stops global test suite failures from unhandled rejections and allows assertion on them.
32+
* onUncaughtException is used in QUnit 2.17 onwards.
3233
*/
33-
this.qunitOnUnhandledRejection = sinon.stub(QUnit, 'onUnhandledRejection');
34+
this.qunitOnUnhandledRejection = sinon.stub(
35+
QUnit,
36+
QUnit.onUncaughtException ? 'onUncaughtException' : 'onUnhandledRejection',
37+
);
3438

3539
QUnit.onError = function({ message }) {
3640
errorMessages.push(message.split('Error: ')[1]);

0 commit comments

Comments
 (0)