The yargs library is my preferred library to implement a CLI. One of the challenges I've come across with yargs is figuring out how to write unit tests using Jest. Let me show you the pattern that I've started to use to test my commands.
How to Test Yargs CLI with Jest
· 3 min read