(handlerFunc gin.HandlerFunc)
| 589 | } |
| 590 | |
| 591 | func bootTestServer(handlerFunc gin.HandlerFunc) (*httptest.Server, *API) { |
| 592 | r := gin.New() |
| 593 | r.Use(handlerFunc) |
| 594 | // ping every 500 ms, and the client has 500 ms to respond |
| 595 | api := New(500*time.Millisecond, 500*time.Millisecond, []string{}) |
| 596 | |
| 597 | r.GET("/", api.Handle) |
| 598 | server := httptest.NewServer(r) |
| 599 | return server, api |
| 600 | } |
| 601 | |
| 602 | func wsURL(httpURL string) string { |
| 603 | return "ws" + strings.TrimPrefix(httpURL, "http") |
no test coverage detected
searching dependent graphs…