-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Description
Describe the bug
I am using the React socket.io-client package to connect to a socket.io websocket. The authentication of the entire application is based on httpOnly cookies (i.e. these cookies can not be accessed through clientside Javascript).
When running the app in developement, everything works as expected: the socket client sets the httpOnly cookie on the handshake request and the server authenticates this.
But when running the Jest test suite, the httpOnly cookie no longer gets set on the handshake.
Note that when making http requests (using fetch) in Jest, the httpOnly cookie DOES get set as expected. So for whatever reason, the socket.io-client is not setting the httpOnly cookie on the handshake request in Jest...
Any help or suggestions would be greatly appreciated! Thank you
Socket.IO server version: ^3.1.0
Socket.IO client version: ^3.1.1