Skip to content

Commit 214e01c

Browse files
gkatsevmisteroneill
authored andcommitted
test(events): silence error logging in tests (#3835)
The error that is logged in this test makes it hard to see what is an actual error in some cases.
1 parent 5ec46b0 commit 214e01c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/unit/events.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* eslint-env qunit */
22
import * as Events from '../../src/js/utils/events.js';
33
import document from 'global/document';
4+
import log from '../../src/js/utils/log.js';
45

56
QUnit.module('Events');
67

@@ -263,6 +264,10 @@ QUnit.test('should have relatedTarget correctly set on the event', function(asse
263264
QUnit.test('should execute remaining handlers after an exception in an event handler', function(assert) {
264265
assert.expect(1);
265266

267+
const oldLogError = log.error;
268+
269+
log.error = function() {};
270+
266271
const el = document.createElement('div');
267272
const listener1 = function() {
268273
throw new Error('GURU MEDITATION ERROR');
@@ -276,4 +281,6 @@ QUnit.test('should execute remaining handlers after an exception in an event han
276281

277282
// 1 click
278283
Events.trigger(el, 'click');
284+
285+
log.error = oldLogError;
279286
});

0 commit comments

Comments
 (0)