Skip to content

Commit

Permalink
change unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
0xc0392b committed Jun 22, 2023
1 parent 48c7e84 commit 036a882
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,13 @@ func TestGraphQL(t *testing.T) {
in1 := `{"id": 1, "type": "ConnectionInit"}`
c.WriteMessage(websocket.TextMessage, []byte(in1))

in2 := `{"id": 2, "type": "Subscribe", "payload": "query { getUser { id, name } }"}`
in2 := `{"id": 2, "type": "Subscribe", "payload": "query { getUser { id } }"}`
c.WriteMessage(websocket.TextMessage, []byte(in2))

in3 := `{"id": 3, "type": "Subscribe", "payload": "query { getUser { name } }"}`
c.WriteMessage(websocket.TextMessage, []byte(in3))

count := 0

for count < 5 {
for count := 0; count < 5; count++ {
c.SetReadDeadline(time.Now().Add(time.Second * 5))
mt, out, err := c.ReadMessage()
if err != nil {
Expand All @@ -59,7 +57,5 @@ func TestGraphQL(t *testing.T) {
}

fmt.Println(string(out))

count += 1
}
}

0 comments on commit 036a882

Please sign in to comment.