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

Function TestHostsIncludesEnvVar

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

Source from the content-addressed store, hash-verified

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