newManager wires a Manager to the fake GitHub server. By default the browser auto-opens (driving the callback) and Docker detection is off.
(t *testing.T, f *fakeGitHub)
| 16 | // newManager wires a Manager to the fake GitHub server. By default the browser |
| 17 | // auto-opens (driving the callback) and Docker detection is off. |
| 18 | func newManager(t *testing.T, f *fakeGitHub) *Manager { |
| 19 | t.Helper() |
| 20 | cfg := Config{ |
| 21 | ClientID: "client-id", |
| 22 | ClientSecret: "client-secret", |
| 23 | Scopes: []string{"repo"}, |
| 24 | Endpoint: f.endpoint(), |
| 25 | } |
| 26 | m := NewManager(cfg, testLogger()) |
| 27 | m.openURL = browserGet |
| 28 | m.inDocker = func() bool { return false } |
| 29 | return m |
| 30 | } |
| 31 | |
| 32 | func TestAuthenticatePKCEViaBrowser(t *testing.T) { |
| 33 | f := newFakeGitHub(t) |
no test coverage detected