spotify-cli-mac icon indicating copy to clipboard operation
spotify-cli-mac copied to clipboard

add tests

Open ersel opened this issue 8 years ago • 2 comments

ersel avatar Jan 30 '17 22:01 ersel

Could you give me some more information about this?

QuadDepo avatar Sep 17 '17 13:09 QuadDepo

Currently, there are no tests around the project. Before publishing a new version each command needs to be tested manually to make sure we didn't break anything.

I think a better approach would be to write some CLI unit tests, which runs each command and checks the if the STDOUT is as expected.

for instance, test searching for artist "Mozart", make sure the first line of output contains: "1: Artist: Wolfgang Amadeus Mozart"

See below link for more information. Although it's not specifically for testing "commander" apps, same principles should be applicable.

https://glebbahmutov.com/blog/unit-testing-cli-programs/

ersel avatar Sep 17 '17 14:09 ersel