()
| 89 | |
| 90 | describe('write', () => { |
| 91 | function captureUnderlyingSocket() { |
| 92 | const original = net.createConnection; |
| 93 | const captured: { socket?: net.Socket } = {}; |
| 94 | const target = net as unknown as { createConnection: unknown }; |
| 95 | target.createConnection = (...args: unknown[]) => { |
| 96 | const s = (original as unknown as (...a: unknown[]) => net.Socket).apply(net, args); |
| 97 | captured.socket = s; |
| 98 | return s; |
| 99 | }; |
| 100 | return { |
| 101 | captured, |
| 102 | restore() { |
| 103 | target.createConnection = original; |
| 104 | } |
| 105 | }; |
| 106 | } |
| 107 | |
| 108 | async function withConnectedSocket( |
| 109 | fn: (socket: RedisSocket, underlying: net.Socket) => Promise<void> |
no outgoing calls
no test coverage detected