mirror of
https://github.com/alibaba/anyproxy.git
synced 2025-08-01 11:39:01 +00:00
fix #427
This commit is contained in:
@@ -4,9 +4,10 @@
|
||||
*/
|
||||
const ProxyServerUtil = require('../util/ProxyServerUtil.js');
|
||||
const { proxyGet } = require('../util/HttpUtil.js');
|
||||
|
||||
const { printLog } = require('../util/CommonUtil.js');
|
||||
|
||||
const domain_not_exists = 'not_exist.not_exist_anyproxy_io_domain.com';
|
||||
|
||||
let errorInRule = null;
|
||||
const ruleNotDealError = {
|
||||
*onError(requestDetail, error) {
|
||||
@@ -62,7 +63,7 @@ function testWrapper(protocol) {
|
||||
});
|
||||
|
||||
it('Should get a request error', done => {
|
||||
const url = protocol + '://not_exist_url.anyproxy.io';
|
||||
const url = protocol + `://${domain_not_exists}`;
|
||||
proxyGet(url)
|
||||
.then(proxyRes => {
|
||||
expect(proxyRes.statusCode).toEqual(500);
|
||||
@@ -99,7 +100,7 @@ function testWrapper(protocol) {
|
||||
});
|
||||
|
||||
it('Should get a request error', done => {
|
||||
const url = protocol + '://not_exist_url.anyproxy.io';
|
||||
const url = protocol + `://${domain_not_exists}`;
|
||||
proxyGet(url)
|
||||
.then(proxyRes => {
|
||||
expect(proxyRes.statusCode).toEqual(200);
|
||||
@@ -140,7 +141,7 @@ function testHttpsConnect() {
|
||||
});
|
||||
|
||||
it('Should get a request error', done => {
|
||||
const url = 'https://not_exist_url.anyproxy.io';
|
||||
const url = `https://${domain_not_exists}`;
|
||||
proxyGet(url)
|
||||
.then(proxyRes => {
|
||||
done.fail('should throw an error when requesting');
|
||||
|
Reference in New Issue
Block a user