mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 10:44:59 +00:00
simplify test config (#639)
This commit is contained in:
21
test/selector.js
Normal file
21
test/selector.js
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* 运行单个测试文件
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
const inquirer = require('inquirer');
|
||||
const path = require('path');
|
||||
const shell = require('shelljs');
|
||||
const files = fs.readdirSync(path.resolve(__dirname, './specs'));
|
||||
|
||||
inquirer.prompt([{
|
||||
type: 'list',
|
||||
name: 'select',
|
||||
message: '请选择要运行的测试文件:',
|
||||
choices: files
|
||||
}]).then(result => {
|
||||
const file = result.select.replace('.spec.js', '');
|
||||
shell.exec('karma start test/karma.conf.js --color alway --file ' + file);
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
});
|
Reference in New Issue
Block a user