Skip to content

Commit

Permalink
added tests, some restructuring and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
George Makroglou committed Jul 24, 2024
1 parent 8f836dc commit d65066a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ func withPath(config *server.SocketServer) {
config.Path = "/wss"
}

func withAnotherPath(config *server.SocketServer) {
config.Path = "/wsss"
}

func TestWrongPort(t *testing.T){

s := server.New(server.NOOPSocketServerEvents{}, withFalsePort)
s := server.New(server.NOOPSocketServerEvents{}, withPath, withFalsePort)

hasError := make(chan bool)

Expand Down Expand Up @@ -61,7 +65,7 @@ func TestWithDefaultConfig(t *testing.T) {

func TestWithCorrectCustomConfig(t *testing.T) {

s := server.New(server.NOOPSocketServerEvents{}, withPort, withPath)
s := server.New(server.NOOPSocketServerEvents{}, withPort, withAnotherPath)

go func() {
time.Sleep(20 * time.Second)
Expand Down

0 comments on commit d65066a

Please sign in to comment.