Created
March 22, 2019 01:02
-
-
Save dancrew32/35d57508c651c8c35ead128a87106fe9 to your computer and use it in GitHub Desktop.
react-stripe-elements mock object so you can run the damn unit tests.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const mockWindowStripe = () => { | |
window.Stripe = () => ({ | |
createSource: jest.fn(), | |
elements: () => ({ | |
create: () => ({ | |
mount: jest.fn(), | |
update: jest.fn(), | |
destroy: jest.fn(), | |
on: jest.fn(), | |
}), | |
}), | |
createToken: jest.fn(), | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment