fix(tests): update AcmeStateManager tests to use socket-handler for challenge routes

fix(tests): enhance non-TLS connection detection with range support in HttpProxy tests
This commit is contained in:
2025-06-01 07:06:11 +00:00
parent a2affcd93e
commit c7c325a7d8
3 changed files with 33 additions and 17 deletions

View File

@ -26,7 +26,6 @@ tap.test('should detect and forward non-TLS connections on HttpProxy ports', asy
proxy.settings.enableDetailedLogging = true;
// Override the HttpProxy initialization to avoid actual HttpProxy setup
const mockHttpProxy = { available: true };
proxy['httpProxyBridge'].initialize = async () => {
console.log('Mock: HttpProxyBridge initialized');
};
@ -49,11 +48,7 @@ tap.test('should detect and forward non-TLS connections on HttpProxy ports', asy
args[1].end(); // socket.end()
};
const originalGetHttpProxy = proxy['httpProxyBridge'].getHttpProxy;
proxy['httpProxyBridge'].getHttpProxy = () => {
console.log('Mock: getHttpProxy called, returning:', mockHttpProxy);
return mockHttpProxy;
};
// No need to mock getHttpProxy - the bridge already handles HttpProxy availability
// Make a connection to port 8080
const client = new net.Socket();