MCPcopy Create free account
hub / github.com/cli/cli / TestHostsIncludesEnvVar

Function TestHostsIncludesEnvVar

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

Source from the content-addressed store, hash-verified

199}
200
201func TestHostsIncludesEnvVar(t *testing.T) {
202 // Given the GH_HOST env var is set
203 authCfg := newTestAuthConfig(t)
204 t.Setenv("GH_HOST", "ghe.io")
205
206 // When we get the hosts
207 hosts := authCfg.Hosts()
208
209 // Then the host in the env var is included
210 require.Contains(t, hosts, "ghe.io")
211}
212
213func TestDefaultHostFromEnvVar(t *testing.T) {
214 // 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