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

Function TestHostsIncludesEnvVar

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

Source from the content-addressed store, hash-verified

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