Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests(events): silence error logging in tests #3835

Merged
merged 1 commit into from
Dec 5, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
});