socketio / socket.io

Realtime application framework (Node.JS server)
https://socket.io
MIT License
61.1k stars 10.11k forks source link

Feature Request: Docs/Support for client side unit testing of socketio clients #5099

Open georgeedwards opened 7 years ago

georgeedwards commented 7 years ago

You want to:

Current behaviour

If you have a front end application which uses the socketio client, it is unclear how you can unit test this functionality. I have described how the issue manifests with angular (but this is applicable to any client side unit testing) here. I can't seem to see any documentation for this or third part blogs/tutorials etc.

Expected behaviour

This should be a supported and documented use case.

georgeedwards commented 7 years ago

@darrachequesne Any ideas on this?

darrachequesne commented 7 years ago

@georgeedwards Module parse failed seems to be webpack (version 1.x, if I'm not mistaken) failing to read the sourcemap file (which is served by the server by default). I think you have to use null-loader to skip that file (see example here, the version on master should work for webpack 2.0).

Else, the workflow described in your stackoverflow question seems good to me. (integration test, not unit test right?)