mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Fix proper closing of http request test ssl/proxy servers
This commit is contained in:
parent
20cf91f1dc
commit
2fef6fd1fa
@ -68,11 +68,11 @@ describe('HTTP Request Node', function() {
|
|||||||
An optional company name []:
|
An optional company name []:
|
||||||
*/
|
*/
|
||||||
};
|
};
|
||||||
testSslServer = https.createServer(sslOptions,testApp);
|
testSslServer = stoppable(https.createServer(sslOptions,testApp));
|
||||||
testSslServer.listen(testSslPort);
|
testSslServer.listen(testSslPort);
|
||||||
|
|
||||||
testProxyPort += 1;
|
testProxyPort += 1;
|
||||||
testProxyServer = httpProxy.createProxyServer({target:'http://localhost:' + testPort});
|
testProxyServer = stoppable(httpProxy.createProxyServer({target:'http://localhost:' + testPort}));
|
||||||
testProxyServer.on('proxyReq', function(proxyReq, req, res, options) {
|
testProxyServer.on('proxyReq', function(proxyReq, req, res, options) {
|
||||||
proxyReq.setHeader('x-testproxy-header', 'foobar');
|
proxyReq.setHeader('x-testproxy-header', 'foobar');
|
||||||
});
|
});
|
||||||
@ -217,8 +217,11 @@ describe('HTTP Request Node', function() {
|
|||||||
|
|
||||||
after(function(done) {
|
after(function(done) {
|
||||||
testServer.stop(() => {
|
testServer.stop(() => {
|
||||||
testProxyServer.close();
|
testProxyServer.stop(() => {
|
||||||
helper.stopServer(done);
|
testSslServer.stop(() => {
|
||||||
|
helper.stopServer(done);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user