(socketPath: string)
| 191 | } |
| 192 | |
| 193 | async function connect(socketPath: string): Promise<{ socket: net.Socket; next: () => Promise<string> }> { |
| 194 | const socket = net.createConnection(socketPath); |
| 195 | socket.on('error', () => { /* torn down at the end */ }); |
| 196 | cleanups.push(() => { socket.destroy(); }); |
| 197 | const next = lineReader(socket); |
| 198 | await new Promise<void>((resolve) => socket.once('connect', () => resolve())); |
| 199 | return { socket, next }; |
| 200 | } |
| 201 | |
| 202 | it('proves it holds this user\'s key, for the path it listens on, before the session starts', async () => { |
| 203 | const socketPath = uniqueSocketPath(); |
no test coverage detected