CLI的commander.js集成testing

我使用commander.js创build了一个CLI 。

我为我的所有源代码编写了unit testing,但是我想写一个使用可执行文件的集成testing。

人们如何testingCLI? 我可以一起破解一些东西,但我认为testingCLI必须有一个最佳实践。

我结束了在我的testing中使用断言function。