xk6-websockets
xk6-websockets copied to clipboard
socket io wrapper with promises
https://gist.github.com/andrew-delph/05a45f7f4293a85755df5fbd15ad26c1
This makes testing so much easier for socket io!
Hey @andrew-delph , thanks for building and sharing the socket.io library/wrapper.
This is definitely something that would be useful for others folks in the community:
- https://community.k6.io/t/k6-socket-loadtest/1730
- https://community.k6.io/t/how-to-capture-the-server-data-in-k6-scripts/1632/3
- https://github.com/grafana/k6/issues/667
- https://github.com/grafana/k6/issues/1306
I will eventually make an example of this with the babel configs so its easy to setup.
Not all k6 users use Typescript, so it would be ideal if the bundler could generate a JS build for non-typescript users.
A JS version gist in case anyone would need it https://gist.github.com/laub1199/2e045c4715ef8c859be9d116353861e2
@sennett-lau the gist doesn't work, do you mind sharing it again? ❤️
@sennett-lau the gist doesn't work, do you mind sharing it again? ❤️
Here you go! I changed the username aha :D
https://gist.github.com/sennett-lau/2e045c4715ef8c859be9d116353861e2
I tried the JS version from @sennett-lau but it is not working. I get this error:
ERRO[0001] TypeError: Value is not an object: undefined
at connect (file:///home/tms/workspace/socketio/libs/K6SocketIoExp.js:7:22(8))
at file:///home/tms/workspace/socketio/src/main.js:34:1(20) executor=per-vu-iterations scenario=default source=stacktrace
Is anyone able to get it working?
Thank you.