fix(routing): unify route based architecture

This commit is contained in:
2025-05-13 12:48:41 +00:00
parent fe632bde67
commit fcc8cf9caa
46 changed files with 7943 additions and 1332 deletions

View File

@ -92,7 +92,8 @@ tap.test('setup port proxy test environment', async () => {
// Test that the proxy starts and its servers are listening.
tap.test('should start port proxy', async () => {
await smartProxy.start();
expect((smartProxy as any).netServers.every((server: net.Server) => server.listening)).toBeTrue();
// Check if the proxy is listening by verifying the ports are active
expect(smartProxy.getListeningPorts().length).toBeGreaterThan(0);
});
// Test basic TCP forwarding.
@ -232,7 +233,8 @@ tap.test('should handle connection timeouts', async () => {
// Test stopping the port proxy.
tap.test('should stop port proxy', async () => {
await smartProxy.stop();
expect((smartProxy as any).netServers.every((server: net.Server) => !server.listening)).toBeTrue();
// Verify that there are no listening ports after stopping
expect(smartProxy.getListeningPorts().length).toEqual(0);
// Remove from tracking
const index = allProxies.indexOf(smartProxy);