doghappy / socket.io-client-csharp

socket.io-client implemention for .NET
MIT License
730 stars 125 forks source link

Add logic to run the different nodejs servers before the tests (if the tests are not running under azure). #167

Closed jlareo closed 3 years ago

jlareo commented 3 years ago

feat: Add logic to run the different nodejs servers before the tests to avoid making a lot of changes in the tests, the logic is performed by using AssemblyInitialize and the AssemblyCleanup instead of TestInitialize and TestCleanup (but could be done if desired). In the future, the tests could be separated in different projects (e.g. UnitTests and IntegrationTests), so, doing the configuration of the different servers should be done only by running the integration tests.

jlareo commented 3 years ago

@doghappy Feel free to reject the PR if you think that it is not worth it to handle the server locally using this logic.

doghappy commented 3 years ago

Awesome ❤

Running the nodejs server automatically is a great idea, but if I want to keep the nodejs console output after the test is complete, or I want to use the Windows Terminal to start the node server...

I think this is a user preference, so the best practice is to add a configuration file to the SocketIOClient.Test project, this file will not be pushed to github, just like the .user file. Of course, you can also use environment variables to do this.

Automatically start nodejs server should be enabled by default.

jlareo commented 3 years ago

Commited