Skip to content

Instantly share code, notes, and snippets.

@ffMathy
Created August 22, 2018 20:35
Show Gist options
  • Save ffMathy/f9507be46ce7a97d7422fe6ff80e952d to your computer and use it in GitHub Desktop.
Save ffMathy/f9507be46ce7a97d7422fe6ff80e952d to your computer and use it in GitHub Desktop.
const mockedCalculator = TypeMoq.Mock.ofType(RealCalculator);
const calculator = mockedCalculator.object;
mockedCalculator.setup(x => x.isEnabled).throws(new Error());
console.log(calculator.isEnabled); //throws
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment