Skip to content

Instantly share code, notes, and snippets.

@ffMathy
Created August 22, 2018 20:34
Show Gist options
  • Save ffMathy/677356082eb6b34723751c35537fe60a to your computer and use it in GitHub Desktop.
Save ffMathy/677356082eb6b34723751c35537fe60a 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(() => 4);
console.log(calculator.add(1, 2)); //4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment