From cd29822b5be01880f62546464dc9cedb8e75d599 Mon Sep 17 00:00:00 2001 From: DhananjayPurohit Date: Mon, 5 Aug 2024 16:20:42 +0530 Subject: [PATCH] fix: add assertion for invoice payment failure --- clients/apps/nodejs/test/tb04-simple-lightning-latch.mjs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/clients/apps/nodejs/test/tb04-simple-lightning-latch.mjs b/clients/apps/nodejs/test/tb04-simple-lightning-latch.mjs index 070bab71..fc27819f 100644 --- a/clients/apps/nodejs/test/tb04-simple-lightning-latch.mjs +++ b/clients/apps/nodejs/test/tb04-simple-lightning-latch.mjs @@ -408,7 +408,11 @@ describe('TB04 - Lightning Latch', function() { const paymentHashSecond = "f768c404215f9fb5731c32c00fe7a057fc181d7695de447b334380d90674db34" const invoiceSecond = await generateInvoice(paymentHashSecond, amount); - await payInvoice(invoiceSecond.payment_request); - }) + try { + await payInvoice(invoiceSecond.payment_request); + } catch (error) { + console.error('Error:', error); + expect(error.message).to.include('failed'); + } }) })