Skip to content

Instantly share code, notes, and snippets.

@ddialar
Created August 12, 2017 11:41
Show Gist options
  • Save ddialar/d0e6c066a3ad5eefaf0c35dec21d2656 to your computer and use it in GitHub Desktop.
Save ddialar/d0e6c066a3ad5eefaf0c35dec21d2656 to your computer and use it in GitHub Desktop.
import 'jest';
var sum = jest.fn().mockReturnValue(20);
var dif = jest.fn().mockReturnValue(-20);
const calculator = jest.mock('../calculator', () => {
return {
sum,
dif
};
});
export default calculator;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment