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

Function TestHasEnvTokenWithEnvToken

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

Source from the content-addressed store, hash-verified

158}
159
160func TestHasEnvTokenWithEnvToken(t *testing.T) {
161 // Given we have an env token set
162 // Note that any valid env var for tokens will do, not just GH_ENTERPRISE_TOKEN
163 authCfg := newTestAuthConfig(t)
164 t.Setenv("GH_ENTERPRISE_TOKEN", "test-token")
165
166 // When we check if it has an env token
167 hasEnvToken := authCfg.HasEnvToken()
168
169 // Then it returns true
170 require.True(t, hasEnvToken, "expected to have env token")
171}
172
173func TestHasEnvTokenWithNoEnvTokenButAConfigVar(t *testing.T) {
174 t.Skip("this test is explicitly breaking some implementation assumptions")

Callers

nothing calls this directly

Calls 2

newTestAuthConfigFunction · 0.85
HasEnvTokenMethod · 0.65

Tested by

no test coverage detected