fix the start issue when webinterface is disabled, andd add test cases

This commit is contained in:
砚然
2018-02-05 21:04:27 +08:00
parent 1405356292
commit 310f84d68f
3 changed files with 21 additions and 12 deletions

View File

@@ -31,9 +31,11 @@ const ProxyServerUtil = require('../util/ProxyServerUtil.js');
testRequest('http');
testRequest('https');
testRequest('http', false);
testRequest('https', false);
// Test suites for http and https request
function testRequest(protocol = 'http') {
function testRequest(protocol = 'http', needWeb = true) {
function constructUrl(urlPath) {
return generateUrl(protocol, urlPath);
}
@@ -47,7 +49,7 @@ function testRequest(protocol = 'http') {
printLog('Start server for no_rule_spec');
serverInstance = new Server();
proxyServer = ProxyServerUtil.defaultProxyServer();
proxyServer = ProxyServerUtil.defaultProxyServer(needWeb);
setTimeout(() => {
done();
}, 2000);