dispatchrun / dispatch

Entrypoint of the Dispatch ecosystem.
11 stars 1 forks source link

test(unit): unit tests for switch command #60

Closed guergabo closed 3 months ago

guergabo commented 3 months ago

Changes

Initial example of how dispatch could run the commands while redirecting stdout / stderr to make assertions. Might be useful for this issue https://github.com/dispatchrun/dispatch/issues/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.

guergabo commented 3 months ago

Ready for review plus have follow-up issue to do similar for the other commands here: https://github.com/dispatchrun/dispatch/issues/61

Let me know if there is anything else I should change. Thanks.