From edd7476af15b4e633e8829fb469bcfc37df27d66 Mon Sep 17 00:00:00 2001 From: boufni95 Date: Mon, 10 Mar 2025 22:49:06 +0000 Subject: [PATCH] fix expected err --- src/tests/externalPayment.spec.ts | 2 +- src/tests/internalPayment.spec.ts | 2 +- src/tests/spamExternalPayments.spec.ts | 2 +- src/tests/spamMixedPayments.spec.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tests/externalPayment.spec.ts b/src/tests/externalPayment.spec.ts index f5524ed1..23191f20 100644 --- a/src/tests/externalPayment.spec.ts +++ b/src/tests/externalPayment.spec.ts @@ -36,7 +36,7 @@ const testFailedExternalPayment = async (T: TestBase) => { expect(invoice.payRequest).to.startWith("lnbcrt15u") T.d("generated 1500 sats invoice for external node") - await expectThrowsAsync(T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice.payRequest, amount: 0 }, application), "not enough balance to decrement") + await expectThrowsAsync(T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice.payRequest, amount: 0 }, application), "Error: not enough balance to decrement") T.d("payment failed as expected, with the expected error message") const u1 = await T.main.storage.userStorage.GetUser(T.user1.userId) expect(u1.balance_sats).to.be.equal(1496) diff --git a/src/tests/internalPayment.spec.ts b/src/tests/internalPayment.spec.ts index 7a4b3055..16b410fb 100644 --- a/src/tests/internalPayment.spec.ts +++ b/src/tests/internalPayment.spec.ts @@ -35,7 +35,7 @@ const testFailedInternalPayment = async (T: TestBase) => { const invoice = await T.main.paymentManager.NewInvoice(T.user2.userId, { amountSats: 1000, memo: "test" }, { linkedApplication: application, expiry: defaultInvoiceExpiry }) expect(invoice.invoice).to.startWith("lnbcrt10u") T.d("generated 1000 sats invoice for user2") - await expectThrowsAsync(T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice.invoice, amount: 0 }, application), "not enough balance to decrement") + await expectThrowsAsync(T.main.paymentManager.PayInvoice(T.user1.userId, { invoice: invoice.invoice, amount: 0 }, application), "Error: not enough balance to decrement") T.d("payment failed as expected, with the expected error message") } diff --git a/src/tests/spamExternalPayments.spec.ts b/src/tests/spamExternalPayments.spec.ts index f1dd114b..a5861542 100644 --- a/src/tests/spamExternalPayments.spec.ts +++ b/src/tests/spamExternalPayments.spec.ts @@ -27,7 +27,7 @@ const testSpamExternalPayment = async (T: TestBase) => { const successfulPayments = res.filter(r => r.success) const failedPayments = res.filter(r => !r.success) - failedPayments.forEach(f => expect(f.err).to.be.equal("not enough balance to decrement")) + failedPayments.forEach(f => expect(f.err).to.be.equal("Error: not enough balance to decrement")) successfulPayments.forEach(s => expect(s.result).to.contain({ amount_paid: 500, network_fee: 1, service_fee: 3 })) expect(successfulPayments.length).to.be.equal(3) expect(failedPayments.length).to.be.equal(7) diff --git a/src/tests/spamMixedPayments.spec.ts b/src/tests/spamMixedPayments.spec.ts index 2b525977..a12a1825 100644 --- a/src/tests/spamMixedPayments.spec.ts +++ b/src/tests/spamMixedPayments.spec.ts @@ -30,7 +30,7 @@ const testSpamExternalPayment = async (T: TestBase) => { const successfulPayments = res.filter(r => r.success) as { success: true, result: Types.PayInvoiceResponse }[] const failedPayments = res.filter(r => !r.success) - failedPayments.forEach(f => expect(f.err).to.be.equal("not enough balance to decrement")) + failedPayments.forEach(f => expect(f.err).to.be.equal("Error: not enough balance to decrement")) expect(successfulPayments.length).to.be.equal(3) expect(failedPayments.length).to.be.equal(7) T.d("3 payments succeeded, 7 failed as expected")