Skip to content

Instantly share code, notes, and snippets.

@ManuViola77
Last active February 12, 2021 05:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ManuViola77/00899b450baebb8ef676c69a31af1b67 to your computer and use it in GitHub Desktop.
Save ManuViola77/00899b450baebb8ef676c69a31af1b67 to your computer and use it in GitHub Desktop.
Complex Image Picker Mock
export default {
openPicker: jest
.fn(() => Promise.resolve(result)) // default implementation
.mockImplementationOnce(() => Promise.reject(result)) // first time is called
.mockImplementationOnce(() => Promise.resolve(result)), // second time is called
};
@dileepab
Copy link

Can you share complete example of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment