Skip to content

Instantly share code, notes, and snippets.

@ffMathy
Created August 22, 2018 20:32
Show Gist options
  • Save ffMathy/3e94d74af22e2ebef24d7194d8142335 to your computer and use it in GitHub Desktop.
Save ffMathy/3e94d74af22e2ebef24d7194d8142335 to your computer and use it in GitHub Desktop.
const mockedCalculator = TypeMoq.Mock.ofType(RealCalculator);
const calculator = mockedCalculator.object;
mockedCalculator.setup(x => x.add(1, 2)).returns(console.log);
calculator.add(1, 2); //will call console.log(1, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment