2

假设我有

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
  })
4

0 回答 0