mock-socket icon indicating copy to clipboard operation
mock-socket copied to clipboard

punycode not found

Open rileytg opened this issue 10 years ago • 3 comments

Error: Cannot find module './punycode' from '/Users/rileytg/code/logview/node_modules/mock-socket/dist'

rileytg avatar Oct 01 '15 19:10 rileytg

@rileytg Sorry for the delay getting back to you. How are you importing the library?

thoov avatar Oct 07 '15 17:10 thoov

Hi,

I also have this problem when I try to do require('mock-socket') in my code. I can load the bundle in the browser and there I'll have window.MockWebSocket etc. but I'm not sure how to import mock-socket and use the mock objects in a test and run it in PhantomJS. The only thing that crossed my mind is to import the individual files, but I can't do that right now because it's an older project and I don't want to setup babel.

nomve avatar Nov 16 '15 14:11 nomve

To answer my own question, I loaded the bundle in the browser (in my case through Karma) and have the modules available as globals. As far as I can tell, there is no way to require a MockWebSocket etc. in this way.

nomve avatar Nov 17 '15 11:11 nomve