element/test/unit/index.js

15 lines
608 B
Vue
Raw Normal View History

2016-10-11 11:00:37 +00:00
// Polyfill fn.bind() for PhantomJS
/* eslint-disable no-extend-native */
Function.prototype.bind = require('function-bind');
2017-09-28 10:01:29 +00:00
require('packages/theme-chalk/lib/index.css');
2016-10-11 11:00:37 +00:00
// require all test files (files that ends with .spec.js)
2017-09-17 16:47:37 +00:00
const testsContext = require.context('./specs', true, /\.spec$/);
2016-10-11 11:00:37 +00:00
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.
const srcContext = require.context('../../src', true, /^\.\/(?!main(\.js)?$)/);
srcContext.keys().forEach(srcContext);