Monorepo for Tangled
0

Configure Feed

Select the types of activity you want to include in your feed.

test(appview/config): cover Hostname port stripping

Niels Mokkenstorm (Jul 22, 2026, 4:18 PM +0200) 75c2e5a3 0ded6dd7

+17
+17
appview/config/config_test.go
··· 30 30 t.Fatalf("TANGLED_KNOT_DEFAULT override = %q, want kt.tngl.oyster.cafe", cfg.Knot.Default) 31 31 } 32 32 } 33 + 34 + func TestHostname_StripsPort(t *testing.T) { 35 + cases := map[string]string{ 36 + "127.0.0.1:3000": "127.0.0.1", 37 + "localhost:3000": "localhost", 38 + "tangled.org": "tangled.org", 39 + "[::1]:3000": "::1", 40 + } 41 + for host, want := range cases { 42 + t.Run(host, func(t *testing.T) { 43 + c := &CoreConfig{AppviewHost: host} 44 + if got := c.Hostname(); got != want { 45 + t.Fatalf("Hostname() with AppviewHost=%q = %q, want %q", host, got, want) 46 + } 47 + }) 48 + } 49 + }