grafana / xk6-websockets

GNU Affero General Public License v3.0
17 stars 6 forks source link

socket io wrapper with promises #34

Open andrew-delph opened 1 year ago

andrew-delph commented 1 year ago

https://gist.github.com/andrew-delph/05a45f7f4293a85755df5fbd15ad26c1

andrew-delph commented 1 year ago

This makes testing so much easier for socket io!

ppcano commented 1 year ago

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:

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.

sennett-lau commented 1 year ago

A JS version gist in case anyone would need it https://gist.github.com/laub1199/2e045c4715ef8c859be9d116353861e2

vvargas90 commented 9 months ago

@sennett-lau the gist doesn't work, do you mind sharing it again? ❤️

sennett-lau commented 9 months ago

@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

andreav commented 1 month ago

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.