Skip to content

Commit

Permalink
test(events): silence error logging in tests (#3835)
Browse files Browse the repository at this point in the history
The error that is logged in this test makes it hard to see what is an actual error in some cases.
  • Loading branch information
gkatsev authored and misteroneill committed Dec 5, 2016
1 parent 5ec46b0 commit 214e01c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/unit/events.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-env qunit */
import * as Events from '../../src/js/utils/events.js';
import document from 'global/document';
import log from '../../src/js/utils/log.js';

QUnit.module('Events');

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

const oldLogError = log.error;

log.error = function() {};

const el = document.createElement('div');
const listener1 = function() {
throw new Error('GURU MEDITATION ERROR');
Expand All @@ -276,4 +281,6 @@ QUnit.test('should execute remaining handlers after an exception in an event han

// 1 click
Events.trigger(el, 'click');

log.error = oldLogError;
});

0 comments on commit 214e01c

Please sign in to comment.