MCPcopy
hub / github.com/cli/cli / TestGraphQLEndpoint

Function TestGraphQLEndpoint

internal/ghinstance/host_test.go:91–124  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

89}
90
91func 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
126func TestRESTPrefix(t *testing.T) {
127 tests := []struct {

Callers

nothing calls this directly

Calls 3

GraphQLEndpointFunction · 0.85
RunMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected