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