MCPcopy Index your code
hub / github.com/cli/cli / TestHostsIncludesEnvVar

Function TestHostsIncludesEnvVar

internal/config/auth_config_test.go:187–197  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

185}
186
187func TestHostsIncludesEnvVar(t *testing.T) {
188 // Given the GH_HOST env var is set
189 authCfg := newTestAuthConfig(t)
190 t.Setenv("GH_HOST", "ghe.io")
191
192 // When we get the hosts
193 hosts := authCfg.Hosts()
194
195 // Then the host in the env var is included
196 require.Contains(t, hosts, "ghe.io")
197}
198
199func TestDefaultHostFromEnvVar(t *testing.T) {
200 // Given the GH_HOST env var is set

Callers

nothing calls this directly

Calls 3

newTestAuthConfigFunction · 0.85
ContainsMethod · 0.80
HostsMethod · 0.65

Tested by

no test coverage detected