From a8fe83c4e10ba8fd6f4f9d7f26093b12a7cbf7af Mon Sep 17 00:00:00 2001 From: 0xzino <0xzino@users.noreply.github.com> Date: Fri, 31 Jul 2026 03:52:14 +0000 Subject: [PATCH] fix: non-null assert payout in worldremit payout validation tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- packages/payments/worldremit/src/index.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/payments/worldremit/src/index.test.ts b/packages/payments/worldremit/src/index.test.ts index c305ec9d..8fd80d42 100644 --- a/packages/payments/worldremit/src/index.test.ts +++ b/packages/payments/worldremit/src/index.test.ts @@ -9,15 +9,15 @@ smokeTest(adapter, { idPrefix: 'payment', requireSupports: false }); describe('payment-worldremit payout validation', () => { it('rejects missing payout recipients before returning a transfer id', async () => { - await expect(adapter.payout(' ', 1000, 'USD', {})).rejects.toThrow('recipient accountId is required'); + await expect(adapter.payout!(' ', 1000, 'USD', {})).rejects.toThrow('recipient accountId is required'); }); it('rejects invalid payout amounts before returning a transfer id', async () => { - await expect(adapter.payout('recipient-1', 0, 'USD', {})).rejects.toThrow('positive finite number'); - await expect(adapter.payout('recipient-1', Number.NaN, 'USD', {})).rejects.toThrow('positive finite number'); + await expect(adapter.payout!('recipient-1', 0, 'USD', {})).rejects.toThrow('positive finite number'); + await expect(adapter.payout!('recipient-1', Number.NaN, 'USD', {})).rejects.toThrow('positive finite number'); }); it('rejects malformed payout currencies before returning a transfer id', async () => { - await expect(adapter.payout('recipient-1', 1000, 'US', {})).rejects.toThrow('3-letter ISO code'); + await expect(adapter.payout!('recipient-1', 1000, 'US', {})).rejects.toThrow('3-letter ISO code'); }); });