Skip to content

Commit e70c16a

Browse files
author
sjhitchner
committed
fixing weirdness with tests only testing root repo not forked repos
1 parent 794217b commit e70c16a

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

graphiql_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package handler_test
1+
package handler
22

33
import (
44
"net/http"
@@ -7,7 +7,6 @@ import (
77
"testing"
88

99
"github.com/graphql-go/graphql/testutil"
10-
"github.com/graphql-go/handler"
1110
)
1211

1312
func TestRenderGraphiQL(t *testing.T) {
@@ -61,7 +60,7 @@ func TestRenderGraphiQL(t *testing.T) {
6160

6261
req.Header.Set("Accept", tc.accept)
6362

64-
h := handler.New(&handler.Config{
63+
h := New(&Config{
6564
Schema: &testutil.StarWarsSchema,
6665
GraphiQL: tc.graphiqlEnabled,
6766
})

handler_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package handler_test
1+
package handler
22

33
import (
44
"encoding/json"
@@ -13,7 +13,6 @@ import (
1313
"context"
1414
"github.com/graphql-go/graphql"
1515
"github.com/graphql-go/graphql/testutil"
16-
"github.com/graphql-go/handler"
1716
)
1817

1918
func decodeResponse(t *testing.T, recorder *httptest.ResponseRecorder) *graphql.Result {
@@ -32,7 +31,8 @@ func decodeResponse(t *testing.T, recorder *httptest.ResponseRecorder) *graphql.
3231
}
3332
return &target
3433
}
35-
func executeTest(t *testing.T, h *handler.Handler, req *http.Request) (*graphql.Result, *httptest.ResponseRecorder) {
34+
35+
func executeTest(t *testing.T, h *Handler, req *http.Request) (*graphql.Result, *httptest.ResponseRecorder) {
3636
resp := httptest.NewRecorder()
3737
h.ServeHTTP(resp, req)
3838
result := decodeResponse(t, resp)
@@ -67,7 +67,7 @@ func TestContextPropagated(t *testing.T) {
6767
queryString := `query={name}`
6868
req, _ := http.NewRequest("GET", fmt.Sprintf("/graphql?%v", queryString), nil)
6969

70-
h := handler.New(&handler.Config{
70+
h := New(&Config{
7171
Schema: &myNameSchema,
7272
Pretty: true,
7373
})
@@ -95,7 +95,7 @@ func TestHandler_BasicQuery_Pretty(t *testing.T) {
9595
queryString := `query=query HeroNameQuery { hero { name } }`
9696
req, _ := http.NewRequest("GET", fmt.Sprintf("/graphql?%v", queryString), nil)
9797

98-
h := handler.New(&handler.Config{
98+
h := New(&Config{
9999
Schema: &testutil.StarWarsSchema,
100100
Pretty: true,
101101
})
@@ -119,7 +119,7 @@ func TestHandler_BasicQuery_Ugly(t *testing.T) {
119119
queryString := `query=query HeroNameQuery { hero { name } }`
120120
req, _ := http.NewRequest("GET", fmt.Sprintf("/graphql?%v", queryString), nil)
121121

122-
h := handler.New(&handler.Config{
122+
h := New(&Config{
123123
Schema: &testutil.StarWarsSchema,
124124
Pretty: false,
125125
})
@@ -147,6 +147,6 @@ func TestHandler_Params_NilParams(t *testing.T) {
147147
}
148148
t.Fatalf("expected to panic, did not panic")
149149
}()
150-
_ = handler.New(nil)
150+
_ = New(nil)
151151

152152
}

0 commit comments

Comments
 (0)