thoov / mock-socket

Javascript mocking library for WebSockets and Socket.IO
MIT License
797 stars 118 forks source link

punycode not found #56

Open rileytg opened 9 years ago

rileytg commented 9 years ago

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

thoov commented 8 years ago

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

nomve commented 8 years ago

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 commented 8 years ago

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.