-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
36 lines (32 loc) · 1.01 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/******************************************
* webserver接口测试入口文件
* @helibb
**/
const fs = require('fs');
const path = require('path');
const log4js = require('log4js');
const config = require('config');
const executor = require('./driver/executor');
const MDParser = require('./parser/md/parser');
const JSParser = require('./parser/js/parser');
log4js.configure(config.logs);
const logger = log4js.getLogger('log_file');
async function start() {
try {
let resArr;
switch (config.dataDocFormat) {
case '.md':
resArr = await MDParser.parserTestSuite(config.test_from_md.from_dir);
break;
case '.js':
resArr = await JSParser.parserTestSuite(config.test_from_md.from_dir);
break;
default:
throw new Error(`配置的测试数据文本类型出错 | ${config.dataDocFormat}`);
}
executor.run(resArr);
} catch (err) {
logger.error(err);
}
}
start();