()
| 37 | }; |
| 38 | |
| 39 | export function getFirstIPv4Address(): string { |
| 40 | let ipaddress = ''; |
| 41 | |
| 42 | const interfaces = os.networkInterfaces(); |
| 43 | for (const [, group] of Object.entries(interfaces)) { |
| 44 | if (group) { |
| 45 | for (const inter of group) { |
| 46 | if (inter && inter.family == 'IPv4' && inter.address != '127.0.0.1') { |
| 47 | ipaddress = inter.address; |
| 48 | break; |
| 49 | } |
| 50 | } |
| 51 | } |
| 52 | } |
| 53 | return ipaddress; |
| 54 | } |
| 55 | |
| 56 | export type FakeServer = { |
| 57 | getRequests: () => express.Request[]; |
no outgoing calls
no test coverage detected