refactor(clientonly): modernize code structure and add comprehensive tests#4022
Conversation
- Test missing/incomplete parameters (address, port) - Test rejection of local addresses (localhost, 127.0.0.1, ::1, etc.) - Test port validation (0, negative, >65535, non-numeric) - Test --use-tls flag parsing - Test server /config/ endpoint availability
- Remove IIFE (Node.js modules are already scoped) - Extract getCommandLineParameter as top-level function - Add connection logging for better debugging
|
Not directly related to this pull request, but I've been wondering whether we need these subdirectories for But maybe I've overlooked something that argues against it... |
|
I'm a bit divided on this. For client-only users, this would be a breaking change. Until now, they have been using For server users it would stay the same command. |
|
yes, I know that it would be a breaking change for client users, so we better don't change it. |
|
Yes, if we had strong arguments for a breaking change, we could certainly make the change, but I don't see them here yet. |
This PR improves
clientonlystart option with better code structure, validation, and comprehensive test coverage.Changes
Refactoring:
getCommandLineParameteras a reusable top-level functionTesting:
Testing
All tests pass: