Skip to content
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

socket io wrapper with promises #34

Open
andrew-delph opened this issue Feb 24, 2023 · 6 comments
Open

socket io wrapper with promises #34

andrew-delph opened this issue Feb 24, 2023 · 6 comments

Comments

@andrew-delph
Copy link

andrew-delph commented Feb 24, 2023

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

@andrew-delph andrew-delph reopened this Feb 24, 2023
@andrew-delph andrew-delph changed the title In the current state of things this doesnt work nearly as well as the regular ws package facing some issues Feb 24, 2023
@andrew-delph andrew-delph changed the title facing some issues socket io wrapper with promises Feb 24, 2023
@andrew-delph
Copy link
Author

This makes testing so much easier for socket io!

@ppcano
Copy link

ppcano commented Mar 20, 2023

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
Copy link

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

@vvargas90
Copy link

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

@sennett-lau
Copy link

@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
Copy link

andreav commented Jul 19, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants