(t *testing.T)
| 88 | } |
| 89 | |
| 90 | func TestTokenStoredInConfig(t *testing.T) { |
| 91 | // Given the user has logged in insecurely |
| 92 | authCfg := newTestAuthConfig(t) |
| 93 | _, err := authCfg.Login("github.com", "test-user", "test-token", "", false) |
| 94 | require.NoError(t, err) |
| 95 | |
| 96 | // When we get the token |
| 97 | cred := authCfg.ActiveToken("github.com") |
| 98 | token, source := cred.Token, cred.Source |
| 99 | |
| 100 | // Then the token is successfully fetched |
| 101 | // and the source is set to oauth_token but this isn't great: |
| 102 | // https://github.com/cli/go-gh/issues/94 |
| 103 | require.Equal(t, "test-token", token) |
| 104 | require.Equal(t, oauthTokenKey, source) |
| 105 | } |
| 106 | |
| 107 | func TestTokenStoredInEnv(t *testing.T) { |
| 108 | // When the user is authenticated via env var |
nothing calls this directly
no test coverage detected