Skip to content

Commit

Permalink
chore: improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
denopink committed Apr 3, 2024
1 parent 239e04c commit ba86d4a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/websocket/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package websocket_test

import (
"context"
"errors"
"fmt"
"net/http"
"net/http/httptest"
Expand Down Expand Up @@ -59,7 +60,9 @@ func (ts *EndToEndTestSuite) TestEndToEnd() {

mt, got, err := c.Read(ctx)
// server will halt until the websocket closes resulting in a EOF
if ts.finished {
var closeErr websocket.CloseError
if ts.finished && errors.As(err, &closeErr) {
assert.Equal(closeErr.Code, websocket.StatusNormalClosure)
return
}

Expand Down

0 comments on commit ba86d4a

Please sign in to comment.