Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Alonso committed Aug 16, 2019
1 parent f4bf8c7 commit 3d32c90
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions codegen/testserver/subscription_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func TestSubscriptions(t *testing.T) {
runtime.GC() // ensure no go-routines left from preceding tests
initialGoroutineCount := runtime.NumGoroutine()

sub := c.Websocket(`subscription { updated }`)
sub := c.Websocket(`subscription { updated }`, nil)

tick <- "message"

Expand Down Expand Up @@ -114,7 +114,7 @@ func TestSubscriptions(t *testing.T) {
"Authorization": "Bearer of the curse",
"number": 32,
"strings": []string{"hello", "world"},
})
}, nil)

var msg struct {
resp struct {
Expand Down
10 changes: 5 additions & 5 deletions example/chat/chat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ func TestChatSubscriptions(t *testing.T) {
srv := httptest.NewServer(handler.GraphQL(NewExecutableSchema(New())))
c := client.New(srv.URL)

sub := c.Websocket(`subscription @user(username:"vektah") { messageAdded(roomName:"#gophers") { text createdBy } }`)
sub := c.Websocket(`subscription @user(username:"vektah") { messageAdded(roomName:"#gophers") { text createdBy } }`, nil)
defer sub.Close()

go func() {
var resp interface{}
time.Sleep(10 * time.Millisecond)
err := c.Post(`mutation {
a:post(text:"Hello!", roomName:"#gophers", username:"vektah") { id }
b:post(text:"Hello Vektah!", roomName:"#gophers", username:"andrey") { id }
c:post(text:"Whats up?", roomName:"#gophers", username:"vektah") { id }
err := c.Post(`mutation {
a:post(text:"Hello!", roomName:"#gophers", username:"vektah") { id }
b:post(text:"Hello Vektah!", roomName:"#gophers", username:"andrey") { id }
c:post(text:"Whats up?", roomName:"#gophers", username:"vektah") { id }
}`, &resp)
assert.NoError(t, err)
}()
Expand Down

0 comments on commit 3d32c90

Please sign in to comment.