Closed ghost closed 4 years ago
👍 I would be interested, I anyway have tests for sifrr-server (based on your awesome lib) in mocha.
Let me know what all test scenarios, we need to test. I can open a PR when I get time.
Test writing would include also coming up with ideas. One thing to test is the recent subscription bug where two subscriptions to the same topic would crash.
@alexhultman can you give an exact example of that bug? @aadityataparia have you made any ground?
Nobody has made any progress
We need integration tests such as posting data to a server, piping that data to md5 checksum and comparing the result with the md5 of that file.
And similar integration tests running actual servers. Using curl or any such tools. A basic test suite for checking basic functionality.
@alexhultman I'm interested to help as well. One addition to the library that will make integration testing much easier and allows collecting test coverage, is to add an inject method that will manually invoke an endpoint. here is an example from another library https://github.com/fastify/fastify/blob/master/docs/Testing.md.
I'm not sure if this would be possible considering the fact that some parts of the library are native C++ code, but if possible, it would be great. This way we can avoid testing using external tools such as curl.
Fastify is nothing but a router, so testing it with a simple unit test makes sense like that. That's no different to how the router is tested already: https://github.com/uNetworking/uWebSockets/blob/master/tests/HttpRouter.cpp
What I want here is an integration test that is more about checking if things actually work together
fact that some parts of the library are native C++ code
It's all C++, 100%
Closing, will move tests to C++ project instead
I want nice JavaScript tests but I have no time to write them myself.
If you want to add tests, good tests, you can PR them. If you write good tests, you can own them and maintain them as you see fit.
I'm thinking uWebSockets.js (server) + websockets/ws (client) + mocha (for tests)
Anyone interested?