假设我有
export class MyCommand {
async run() {
this.someCommand();
...
}
someCommand() {
}
}
我想为该run
命令编写一个测试,但模拟出someCommand
. 你如何使用
test
.stdout()
.command()
.it('should run the run command', () => {
// also test that someCommand was called
})