(t *testing.T, allowedOrigins []string)
| 14 | ) |
| 15 | |
| 16 | func newWebSocketTestServer(t *testing.T, allowedOrigins []string) *httptest.Server { |
| 17 | t.Helper() |
| 18 | |
| 19 | logger := zap.NewNop() |
| 20 | svc := &graphjinService{ |
| 21 | conf: &Config{ |
| 22 | Serv: Serv{ |
| 23 | AllowedOrigins: allowedOrigins, |
| 24 | }, |
| 25 | }, |
| 26 | log: logger.Sugar(), |
| 27 | zlog: logger, |
| 28 | } |
| 29 | |
| 30 | hs := &HttpService{} |
| 31 | hs.Store(svc) |
| 32 | |
| 33 | ah, err := auth.NewAuthHandlerFunc(auth.Auth{Type: "none"}) |
| 34 | if err != nil { |
| 35 | t.Fatalf("new auth handler: %v", err) |
| 36 | } |
| 37 | |
| 38 | return httptest.NewServer(hs.GraphQL(ah)) |
| 39 | } |
| 40 | |
| 41 | func dialWS(ctx context.Context, t *testing.T, url string, header http.Header) (*websocket.Conn, *http.Response, error) { |
| 42 | t.Helper() |
no test coverage detected