fix(tests): fix tests
This commit is contained in:
@ -315,8 +315,6 @@ tap.test('WrappedSocket - should handle encoding and address methods', async ()
|
||||
tap.test('WrappedSocket - should work with ConnectionManager', async () => {
|
||||
// This test verifies that WrappedSocket can be used seamlessly with ConnectionManager
|
||||
const { ConnectionManager } = await import('../ts/proxies/smart-proxy/connection-manager.js');
|
||||
const { SecurityManager } = await import('../ts/proxies/smart-proxy/security-manager.js');
|
||||
const { TimeoutManager } = await import('../ts/proxies/smart-proxy/timeout-manager.js');
|
||||
|
||||
// Create minimal settings
|
||||
const settings = {
|
||||
@ -328,9 +326,17 @@ tap.test('WrappedSocket - should work with ConnectionManager', async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const securityManager = new SecurityManager(settings);
|
||||
const timeoutManager = new TimeoutManager(settings);
|
||||
const connectionManager = new ConnectionManager(settings, securityManager, timeoutManager);
|
||||
// Create a mock SmartProxy instance
|
||||
const mockSmartProxy = {
|
||||
settings,
|
||||
securityManager: {
|
||||
trackConnectionByIP: () => {},
|
||||
untrackConnectionByIP: () => {},
|
||||
removeConnectionByIP: () => {}
|
||||
}
|
||||
} as any;
|
||||
|
||||
const connectionManager = new ConnectionManager(mockSmartProxy);
|
||||
|
||||
// Create a simple test server
|
||||
const server = net.createServer();
|
||||
|
Reference in New Issue
Block a user