-
-
Notifications
You must be signed in to change notification settings - Fork 52
bin: add a flag to list the subsystems #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bin: add a flag to list the subsystems #67
Conversation
This commit adds the flag --list-subsystems to list all the subsystems that are available for use. fixes nodejs#66
of course i didn't run npm test before i created this 😢 let me fix those linter issue quick |
Codecov Report
@@ Coverage Diff @@
## master #67 +/- ##
===========================================
- Coverage 98.07% 57.14% -40.94%
===========================================
Files 13 18 +5
Lines 208 448 +240
===========================================
+ Hits 204 256 +52
- Misses 4 192 +188
Continue to review full report at Codecov.
|
I also wonder if it makes sense to sort the printed list? |
One other thing: Would you be willing to add a test for this functionality? |
yes to the test |
What did you have in mind as a test for this. It doesn't actually return anything, just prints to the console. I guess maybe we could test that the appropriate flag was called? |
Good question. Maybe create a new file in |
That sounds good. that will also be a good starting point for adding tests for the other flags in the future |
I've added a test for the I went back and forth on how this test should actually be. I ended up just doing a string compare of what was in my terminal and what outputs from the child process stdout. I also thought about extracting the outputted subsystems into an array and then comparing that against the list of subsystems available to make sure they were all there. maybe that is thinking to much about it :) |
I'm okay with the test as-is, but if you want to go the extra mile then that would mean the test wouldn't have to be manually updated in the future if more subsystems are added. It could also check, for example, that no subsystem appears more than once in the list. |
I'm going to refactor and do the list comparison. |
…ted instead of the actual visual output
I've refactored the test to now compare the list of subsystems that were output with the original list. Doing it this way I think makes a little more sense that trying to compare the visual representation of it |
This commit adds the flag --list-subsystems to list all the subsystems that are available for use.
fixes #66
Since the output is rather long is just listing in one column, so i'm using 3 columns when doing the listing.