diff --git a/packages/test-utils/src/mount.js b/packages/test-utils/src/mount.js index 01c2ec7da..b59ef7192 100644 --- a/packages/test-utils/src/mount.js +++ b/packages/test-utils/src/mount.js @@ -1,7 +1,5 @@ // @flow -import './matches-polyfill' -import './object-assign-polyfill' import Vue from 'vue' import VueWrapper from './vue-wrapper' import createInstance from 'create-instance' diff --git a/packages/test-utils/src/object-assign-polyfill.js b/packages/test-utils/src/object-assign-polyfill.js deleted file mode 100644 index 16851a00d..000000000 --- a/packages/test-utils/src/object-assign-polyfill.js +++ /dev/null @@ -1,23 +0,0 @@ -if (typeof Object.assign !== 'function') { - (function () { - Object.assign = function (target) { - 'use strict' - if (target === undefined || target === null) { - throw new TypeError('Cannot convert undefined or null to object') - } - - var output = Object(target) - for (var index = 1; index < arguments.length; index++) { - var source = arguments[index] - if (source !== undefined && source !== null) { - for (var nextKey in source) { - if (source.hasOwnProperty(nextKey)) { - output[nextKey] = source[nextKey] - } - } - } - } - return output - } - })() -} diff --git a/test/setup/karma.conf.js b/test/setup/karma.conf.js index b99b4651e..fe87ad6eb 100644 --- a/test/setup/karma.conf.js +++ b/test/setup/karma.conf.js @@ -7,6 +7,7 @@ module.exports = function (config) { reporters: ['spec'], files: [ '../../node_modules/babel-polyfill/dist/polyfill.js', + './polyfills.js', 'load-tests.js' ], preprocessors: { diff --git a/packages/test-utils/src/matches-polyfill.js b/test/setup/polyfills.js similarity index 79% rename from packages/test-utils/src/matches-polyfill.js rename to test/setup/polyfills.js index cecb679a6..68b39779e 100644 --- a/packages/test-utils/src/matches-polyfill.js +++ b/test/setup/polyfills.js @@ -6,8 +6,8 @@ if (typeof Element !== 'undefined' && !Element.prototype.matches) { Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector || function (s) { - const matches = (this.document || this.ownerDocument).querySelectorAll(s) - let i = matches.length + var matches = (this.document || this.ownerDocument).querySelectorAll(s) + var i = matches.length while (--i >= 0 && matches.item(i) !== this) {} return i > -1 }