fix: non-null assert payout in worldremit payout validation tests - #881
Merged
Merged
Conversation
payout() is optional in PaymentProvider, so calling adapter.payout() directly triggers TS2722 (Cannot invoke an object which is possibly 'undefined') and breaks the package build. WorldRemit is a payouts adapter that always implements payout(), so add the non-null assertion. Build was failing: pnpm -r build → worldremit Failed (4x TS2722)
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
1 similar comment
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
Contributor
Author
|
Thanks for merging! This fix was submitted under the ugig.net bounty "I will pay for every bug fix found and PR submitted" (https://ugig.net/bounties — bounty c3137a9d-de39-4c1e-b48a-3df804c32bdf). Claim submission ID 8a22db62 (pending review). Payment: $1 SOL per fix PR. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
pnpm -r buildfails on@profullstack/sh1pt-payment-worldremitwith 4× TS2722 (Cannot invoke an object which is possibly undefined) atsrc/index.test.tslines 12, 16, 17, 21.payout()is optional in thePaymentProviderinterface, soadapter.payout(...)in the tests is typed as possibly-undefined. WorldRemit is a payouts adapter that always implementspayout().Fix
Use non-null assertion (
adapter.payout!) in the payout validation tests.Verification
pnpm --filter @profullstack/sh1pt-payment-worldremit build→ passesnpx vitest run packages/payments/worldremit→ 5/5 passpnpm -r build→ 681 packages done, 0 errors