(t *testing.T)
| 89 | } |
| 90 | |
| 91 | func TestGraphQLEndpoint(t *testing.T) { |
| 92 | tests := []struct { |
| 93 | host string |
| 94 | want string |
| 95 | }{ |
| 96 | { |
| 97 | host: "github.com", |
| 98 | want: "https://api.github.com/graphql", |
| 99 | }, |
| 100 | { |
| 101 | host: "github.localhost", |
| 102 | want: "http://api.github.localhost/graphql", |
| 103 | }, |
| 104 | { |
| 105 | host: "garage.github.com", |
| 106 | want: "https://garage.github.com/api/graphql", |
| 107 | }, |
| 108 | { |
| 109 | host: "ghe.io", |
| 110 | want: "https://ghe.io/api/graphql", |
| 111 | }, |
| 112 | { |
| 113 | host: "tenant.ghe.com", |
| 114 | want: "https://api.tenant.ghe.com/graphql", |
| 115 | }, |
| 116 | } |
| 117 | for _, tt := range tests { |
| 118 | t.Run(tt.host, func(t *testing.T) { |
| 119 | if got := GraphQLEndpoint(tt.host); got != tt.want { |
| 120 | t.Errorf("GraphQLEndpoint() = %v, want %v", got, tt.want) |
| 121 | } |
| 122 | }) |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | func TestRESTPrefix(t *testing.T) { |
| 127 | tests := []struct { |
nothing calls this directly
no test coverage detected