-
Notifications
You must be signed in to change notification settings - Fork 209
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
adding tests for CLI functionality - brainstorming #1694
Comments
cc @VibhorCodecianGupta @harshkhandeparkar @blurry-x-face who've all worked on related parts of this before... hope you're well, just seeing if this seems interesting! Also @publiclab/is-reviewers @publiclab/image-sequencer-guides |
@jywarren is it open to work/brainstorm on? We can do something like ./index.js --test and run the series of CLI tests on a new commander instance we want. ( Inspiration can be taken from how |
@daemon1024 we'd LOVE help with this. would you be interested in submitting a PR with even a simple version of this? |
@jywarren i will start working on it. |
Trying to think through the best way to do better CLI testing. Right now we have only: https://github.com/publiclab/image-sequencer/blob/440c3e0ad0ab081bdcc7dfff0d000f52a0902035/test/core/cli.js which is pretty non-existent.
Noting that we encountered this in #659 but did not at that time implement tests.
Ok, so I had thought this was the way to go, installing https://github.com/sstephenson/bats (blog https://medium.com/@pimterry/testing-your-shell-scripts-with-bats-abfca9bdc5b9) and comparing images like perhaps:
But actually maybe it's just easier to use one of our existing JS tests and running our CLI tests from inside node, like this:
https://stackoverflow.com/questions/44647778/how-to-run-shell-script-file-using-nodejs#44667294 has some guidance on this.
Is there a standard way to write CLI tests for
commander.js
?UPDATE: yes, it looks like there are some good ways: tj/commander.js#438
The text was updated successfully, but these errors were encountered: