OClif mock method

142 Views Asked by At

Let's say I have

export class MyCommand {
  async run() {
    this.someCommand();
    ...
  }

  someCommand() {

  }
}

I want to write a test for the run command but mock out the someCommand. How do you do that using the

test
  .stdout()
  .command()
  .it('should run the run command', () => {
     // also test that someCommand was called
  })
0

There are 0 best solutions below