From 208260d017e3980240d8f7695b44e775b2daffc5 Mon Sep 17 00:00:00 2001 From: Christopher McCulloh Date: Wed, 28 Jun 2017 15:31:13 -0400 Subject: [PATCH] adds polyfill for Event for IE --- test/helpers.js | 2 +- test/tests.js | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/test/helpers.js b/test/helpers.js index 909a5e367..112922020 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -1,7 +1,7 @@ /* global QUnit:false, module:false, test:false, asyncTest:false, expect:false */ /* global start:false, stop:false ok:false, equal:false, notEqual:false, deepEqual:false */ /* global notDeepEqual:false, strictEqual:false, notStrictEqual:false, raises:false */ -define(function treeDataFactory (require) { +define(function helpersFactory (require) { var $ = require('jquery'); var KEYMAP = { diff --git a/test/tests.js b/test/tests.js index 2bcb57402..9c5e233b3 100644 --- a/test/tests.js +++ b/test/tests.js @@ -41,6 +41,21 @@ define(function testWrapper (require) { }; }); + (function polyFillEventForIE () { + if ( typeof window.Event === 'function' ) return false; + + function Event ( event, params ) { + params = params || { bubbles: false, cancelable: false, detail: undefined }; + var evt = document.createEvent( 'Event' ); + evt.initEvent( event, params.bubbles, params.cancelable, params.detail ); + return evt; + } + + Event.prototype = window.Event.prototype; + + window.Event = Event; + })(); + require('moment'); require('./test/checkbox-test'); require('./test/combobox-test');