Open History to see the last commit
1import { expect, it } from "@effect/vitest";
2
3import { resolveHeadlessConnectionString } from "./startupAccess.ts";
4
5it("resolves wildcard hosts to a concrete external interface when one is available", () => {
6 const connectionString = resolveHeadlessConnectionString("0.0.0.0", 3773, {
7 en0: [
8 {
9 address: "192.168.1.42",
10 netmask: "255.255.255.0",
11 family: "IPv4",
12 mac: "00:00:00:00:00:00",
13 internal: false,
14 cidr: "192.168.1.42/24",
15 },
16 ],
17 lo0: [
18 {
19 address: "127.0.0.1",
20 netmask: "255.0.0.0",
21 family: "IPv4",
22 mac: "00:00:00:00:00:00",
23 internal: true,
24 cidr: "127.0.0.1/8",
25 },
26 ],
27 });
28
29 expect(connectionString).toBe("http://192.168.1.42:3773");
30});