Testing feathers socket

Viewed 98

I have hardly done anything with feathers sockets so far and therefore I need your help. I have written a test which tests the functionality of my websocket to move users into the right channels. To do this I created two socketIo-clients in my test and let them connect to the websocket with the help of my own helpers, which also do the authentication when the connection is established. If I run the test on its own, it will work fine. But once I run all the tests together, the test no longer works, because the SocketIo-Clients can not established any connection. This can be noticed, because no connection event is triggered at the server.

In my Test I do:

before((done) => {
        server = app.listen(app.get('port'), done);
        socketUrl = 'ws://localhost:5555}/';
    });
socket = io(socketUrl);

and

    after(async () => {
        await server.close();
    });

I found out, that any test, which is also doing server = app.listen(app.get('port'), done); before the socket test, will cause the socket test to fail. Can it be possible, that await server.close(); does not really close the http-server and/or the ws-server?

0 Answers
Related