simplify test config (#639)

This commit is contained in:
neverland
2018-02-12 16:16:57 +08:00
committed by GitHub
parent e1544fe919
commit e1123c4116
72 changed files with 23 additions and 3828 deletions

16
test/index.js Normal file
View File

@@ -0,0 +1,16 @@
require('packages/vant-css/src/index.css');
// hack for test touch event
window.ontouchstart = {};
// 读取配置文件,判断运行单个测试文件还是所有测试文件
const testsReq = require.context('./specs', true, /\.spec$/);
if (process.env.TEST_FILE) {
testsReq.keys().forEach((file) => {
if (file.indexOf(process.env.TEST_FILE) !== -1) {
testsReq(file);
}
});
} else {
testsReq.keys().forEach(testsReq);
}