-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot receive Buffer in NodeJS server/client #3316
Comments
@darrachequesne could u look at this please? |
@jacargentina thanks for providing a way to reproduce, that really helps 👍 That looks reaaaaaally weird, I'm not able to reproduce within the fiddle: https://github.com/socketio/socket.io-fiddle/tree/issues-3316
Hmm... could it be related to Edit: possibly related to jestjs/jest#3186 |
@darrachequesne you're right with jest, replacing with mocha just works! At least i can go on with mocha, while jest team fixes this. |
skip events related to socketio/socket.io#3316
@jacargentina , @darrachequesne I've spent three days to diagnosis this issue. Anyway.. Yes, Mocha testing works seamlessly and I also use Mocha when testing socket.io related code. I've just realized that if server As a workaround if (process.env.NODE_ENV === 'test') {
io = require('socket.io')(server, { allowUpgrades : false });
} else {
// current socket constuction code
} If the issue is the same as mine it must works. Edit const socket = require('socket.io-client')(serverUrl, {upgrade: false}); |
Closed due to inactivity, please reopen if needed. |
You want to:
Current behaviour
Emitting a
Buffer
is not working, the client is not receiving anything.Steps to reproduce
git clone https://github.com/jacargentina/socket-test
cd socket-test
npm install
npm run test-fail
Also can do
npm run test-pass
which is exactly the same but emitting a string, which simply works!Expected behaviour
Should just work
Setup
The text was updated successfully, but these errors were encountered: