-
Notifications
You must be signed in to change notification settings - Fork 1
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
Jdp debugger client tests #6
base: jerry-debugger-proxy
Are you sure you want to change the base?
Jdp debugger client tests #6
Conversation
@martijnthe, when I just said jest.mock('ws') that worked up until this last test I'm trying to write, but I'm wanting to emit events on the websocket to get the on('open') handler called and such. Here is my not working attempt so far... |
04eefab
to
da112ed
Compare
Ah sorry I missed this PR and it's conflicting with the changes I made w.r.t. switching to the nicer CLI arg parser. Mind rebasing / updating this? |
Yeah, I'll try to get back to this at some point. |
70135ee
to
b584d9d
Compare
JerryScript-DCO-1.0-Signed-off-by: Geoff Gustafson [email protected]
67231f0
to
e85a555
Compare
I tried and failed to mock stuff like on() and emit() in the WebSocket module to test additional the 'open' and 'error' cases etc, but just couldn't make it work. Part of the difficulty I think is that the WebSocket module is a constructor. Maybe later I'll have learned enough about Jest to make it work, but moving on to other things. |
JerryScript-DCO-1.0-Signed-off-by: Geoff Gustafson [email protected]
Realized lint was failing - fixed two issues but the third one requires me to return the promise - if I do I realize it's not getting resolved, and I'm back to that problem where I can't figure out how to override functions in the WebSocket mock to provide this functionality. @martijnthe, any insight? |
@grgustaf this fixes it:
You could also use |
OK, sounds good. |
JerryScript-DCO-1.0-Signed-off-by: Geoff Gustafson [email protected]
No description provided.