vue-smart-table
Version:
A table with dynamic components for vue.js
38 lines (33 loc) • 1.17 kB
JavaScript
// Polyfill fn.bind() for PhantomJS
/* eslint-disable no-extend-native */
Function.prototype.bind = require('function-bind')
// Polyfill array.find() for PhantomJS
if (!Array.prototype.find) {
Array.prototype.find = function (predicate) {
if (this == null) {
throw new TypeError('Array.prototype.find called on null or undefined')
}
if (typeof predicate !== 'function') {
throw new TypeError('predicate must be a function')
}
var list = Object(this)
var length = list.length >>> 0
var thisArg = arguments[1]
var value
for (var i = 0; i < length; i++) {
value = list[i]
if (predicate.call(thisArg, value, i, list)) {
return value
}
}
return undefined
}
}
// require all test files (files that ends with .spec.js)
var testsContext = require.context('./specs', true, /\.spec$/)
testsContext.keys().forEach(testsContext)
// require all src files except main.js for coverage.
// you can also change this to match only the subset of files that
// you want coverage for.
var srcContext = require.context('../../src', true, /^\.\/(?!main(\.js)?$)/)
srcContext.keys().forEach(srcContext)