Skip to content

Commit

Permalink
test: fix mock for useStripe (#1559)
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
zubko authored Jan 11, 2024
1 parent f1fe125 commit c436c0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jest/mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,5 +186,5 @@ module.exports = {
GooglePayButton: () => 'GooglePayButton',
AddToWalletButton: () => 'AddToWalletButton',
PlatformPayButton: () => 'PlatformPayButton',
useStripe: jest.fn(() => mockHooks),
useStripe: jest.fn(() => mockFunctions),
};

0 comments on commit c436c0e

Please sign in to comment.