Skip to content

Instantly share code, notes, and snippets.

@ffMathy
Created August 22, 2018 20:35
Show Gist options
  • Save ffMathy/97279c9cdb921e250f7db739a509404f to your computer and use it in GitHub Desktop.
Save ffMathy/97279c9cdb921e250f7db739a509404f to your computer and use it in GitHub Desktop.
const mockedCalculator = mock(RealCalculator);
const calculator = instance(mockedCalculator);
when(mockedCalculator.isEnabled).thenThrow(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