Skip to content

Instantly share code, notes, and snippets.

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