test(unit): unit tests for switch command#60
Merged
achille-roussel merged 5 commits intodispatchrun:mainfrom May 24, 2024
guergabo:unit-tests
Merged
test(unit): unit tests for switch command#60achille-roussel merged 5 commits intodispatchrun:mainfrom guergabo:unit-tests
achille-roussel merged 5 commits intodispatchrun:mainfrom
guergabo:unit-tests
Conversation
Contributor
achille-roussel
left a comment
There was a problem hiding this comment.
Thanks a lot for submitting your first contribution! I left a few comments, let me know what you think about it!.
Contributor
Author
|
Ready for review plus have follow-up issue to do similar for the other commands here: #61 Let me know if there is anything else I should change. Thanks. |
achille-roussel
approved these changes
May 24, 2024
Contributor
achille-roussel
left a comment
There was a problem hiding this comment.
The change is looking good, thanks for your contribution 🙌
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Initial example of how dispatch could run the commands while redirecting stdout / stderr to make assertions. Might be useful for this issue #58.
Potential Next Steps
The global variables make running a bunch of unit tests in parallel more challenging, but if each CLI command takes in an "IO" interface with methods to read/write or make network calls then mocking, running tests in parallel, and focusing on the logic rather than environment setup would be a lot easier.