Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix mock for useStripe #1559

Merged
merged 1 commit into from
Jan 11, 2024
Merged

Conversation

zubko
Copy link
Contributor

@zubko zubko commented Nov 14, 2023

Summary

change useStripe mock to return functions rather than other hooks

Motivation

My unit test failed on the mock provided from this repo.

In reality useStripe doesn't return 100% all functions listed in the mockFunctions object, but using a superset for the mock should still be fine as TS won't allow calling the functions which are not in the declared in the return value type of useStripe. Returning hooks definitely is not what happens in useStripe.

Testing

  • I tested this manually
  • I added automated tests

No need for automated tests

Documentation

  • I have added relevant documentation for my changes.
  • This PR does not result in any developer-facing changes.

`useStripe` returns functions rather than other hooks.

In reality it doesn't return all functions from the `mockFunctions` object, but using a superset for the mock should still be fine as TS won't allow calling the functions which are not in the declared type of the hook.
@CLAassistant
Copy link

CLAassistant commented Nov 14, 2023

CLA assistant check
All committers have signed the CLA.

@zubko
Copy link
Contributor Author

zubko commented Dec 23, 2023

Hi @charliecruzan-stripe ,
Can you check this one please? ☝️ 🙏

@charliecruzan-stripe charliecruzan-stripe merged commit c436c0e into stripe:master Jan 11, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants