diff options
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-pay-paid.ts')
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-pay-paid.ts | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-pay-paid.ts b/packages/taler-harness/src/integrationtests/test-pay-paid.ts index 2ef91e4a8..a377b7237 100644 --- a/packages/taler-harness/src/integrationtests/test-pay-paid.ts +++ b/packages/taler-harness/src/integrationtests/test-pay-paid.ts @@ -17,7 +17,7 @@ /** * Imports. */ -import { GlobalTestState, MerchantPrivateApi } from "../harness/harness.js"; +import { GlobalTestState, MerchantPrivateApi, harnessHttpLib } from "../harness/harness.js"; import { withdrawViaBank, createFaultInjectedMerchantTestkudosEnvironment, @@ -28,8 +28,6 @@ import { ConfirmPayResultType, URL, } from "@gnu-taler/taler-util"; -import axiosImp from "axios"; -const axios = axiosImp.default; import { FaultInjectionRequestContext } from "../harness/faultInjection.js"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; @@ -86,9 +84,7 @@ export async function runPayPaidTest(t: GlobalTestState) { t.assertTrue(orderStatus.already_paid_order_id === undefined); let publicOrderStatusUrl = orderStatus.order_status_url; - let publicOrderStatusResp = await axios.get(publicOrderStatusUrl, { - validateStatus: () => true, - }); + let publicOrderStatusResp = await harnessHttpLib.fetch(publicOrderStatusUrl); if (publicOrderStatusResp.status != 402) { throw Error( @@ -97,7 +93,7 @@ export async function runPayPaidTest(t: GlobalTestState) { } let pubUnpaidStatus = codecForMerchantOrderStatusUnpaid().decode( - publicOrderStatusResp.data, + publicOrderStatusResp.json(), ); console.log(pubUnpaidStatus); @@ -113,9 +109,7 @@ export async function runPayPaidTest(t: GlobalTestState) { const proposalId = preparePayResp.proposalId; - publicOrderStatusResp = await axios.get(publicOrderStatusUrl, { - validateStatus: () => true, - }); + publicOrderStatusResp = await harnessHttpLib.fetch(publicOrderStatusUrl); if (publicOrderStatusResp.status != 402) { throw Error( @@ -124,7 +118,7 @@ export async function runPayPaidTest(t: GlobalTestState) { } pubUnpaidStatus = codecForMerchantOrderStatusUnpaid().decode( - publicOrderStatusResp.data, + publicOrderStatusResp.json(), ); const confirmPayRes = await wallet.client.call( @@ -136,14 +130,12 @@ export async function runPayPaidTest(t: GlobalTestState) { t.assertTrue(confirmPayRes.type === ConfirmPayResultType.Done); - publicOrderStatusResp = await axios.get(publicOrderStatusUrl, { - validateStatus: () => true, - }); + publicOrderStatusResp = await harnessHttpLib.fetch(publicOrderStatusUrl); - console.log(publicOrderStatusResp.data); + console.log(publicOrderStatusResp.json()); if (publicOrderStatusResp.status != 200) { - console.log(publicOrderStatusResp.data); + console.log(publicOrderStatusResp.json()); throw Error( `expected status 200 (after paying), but got ${publicOrderStatusResp.status}`, ); |