(t *testing.T)
| 77 | } |
| 78 | |
| 79 | func TestTokenStoredInConfig(t *testing.T) { |
| 80 | // Given the user has logged in insecurely |
| 81 | authCfg := newTestAuthConfig(t) |
| 82 | _, err := authCfg.Login("github.com", "test-user", "test-token", "", false) |
| 83 | require.NoError(t, err) |
| 84 | |
| 85 | // When we get the token |
| 86 | token, source := authCfg.ActiveToken("github.com") |
| 87 | |
| 88 | // Then the token is successfully fetched |
| 89 | // and the source is set to oauth_token but this isn't great: |
| 90 | // https://github.com/cli/go-gh/issues/94 |
| 91 | require.Equal(t, "test-token", token) |
| 92 | require.Equal(t, oauthTokenKey, source) |
| 93 | } |
| 94 | |
| 95 | func TestTokenStoredInEnv(t *testing.T) { |
| 96 | // When the user is authenticated via env var |
nothing calls this directly
no test coverage detected