( r: RunningServer, target: number, timeoutMs: number, )
| 172 | } |
| 173 | |
| 174 | async function waitForRegistrySize( |
| 175 | r: RunningServer, |
| 176 | target: number, |
| 177 | timeoutMs: number, |
| 178 | ): Promise<void> { |
| 179 | const deadline = Date.now() + timeoutMs; |
| 180 | while (Date.now() < deadline) { |
| 181 | const size = r.services.invokeFunction((a) => a.get(IConnectionRegistry).size()); |
| 182 | if (size === target) return; |
| 183 | await new Promise((res) => { |
| 184 | setTimeout(res, 10); |
| 185 | }); |
| 186 | } |
| 187 | throw new Error(`registry size ${String(target)} not observed within ${String(timeoutMs)}ms`); |
| 188 | } |
| 189 | |
| 190 | describe('GET /api/v1/connections', () => { |
| 191 | it('returns an empty list when no clients are attached', async () => { |
no test coverage detected