Open rileytg opened 9 years ago
@rileytg Sorry for the delay getting back to you. How are you importing the library?
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.
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.
Error: Cannot find module './punycode' from '/Users/rileytg/code/logview/node_modules/mock-socket/dist'