Jdp debugger client tests#6
Jdp debugger client tests#6grgustaf wants to merge 3 commits intomartijnthe:jerry-debugger-proxyfrom
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 geoff@linux.intel.com
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 geoff@linux.intel.com
|
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 geoff@linux.intel.com
No description provided.