Skip to content

Instantly share code, notes, and snippets.

@ffMathy
Created August 22, 2018 20:35
Show Gist options
  • Save ffMathy/4be34a078c6af3ad0a09c8f4d4f31cb6 to your computer and use it in GitHub Desktop.
Save ffMathy/4be34a078c6af3ad0a09c8f4d4f31cb6 to your computer and use it in GitHub Desktop.
const mockedCalculator = Substitute.for<RealCalculator>();
mockedCalculator.isEnabled.returns(() => throw 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