diff options
Diffstat (limited to 'packages/taler-integrationtests/src')
15 files changed, 65 insertions, 37 deletions
diff --git a/packages/taler-integrationtests/src/helpers.ts b/packages/taler-integrationtests/src/helpers.ts index 515ae54bd..d47d5f7b0 100644 --- a/packages/taler-integrationtests/src/helpers.ts +++ b/packages/taler-integrationtests/src/helpers.ts @@ -257,7 +257,6 @@ export async function startWithdrawViaBank(    t.assertTrue(r2.type === "response");  } -  /**   * Withdraw balance.   */ @@ -270,7 +269,6 @@ export async function withdrawViaBank(      amount: AmountString;    },  ): Promise<void> { -    const { wallet } = p;    await startWithdrawViaBank(t, p); @@ -282,4 +280,3 @@ export async function withdrawViaBank(    const balApiResp = await wallet.apiRequest("getBalances", {});    t.assertTrue(balApiResp.type === "response");  } - diff --git a/packages/taler-integrationtests/src/test-bank-api.ts b/packages/taler-integrationtests/src/test-bank-api.ts index 1c233a55c..1088ff6e6 100644 --- a/packages/taler-integrationtests/src/test-bank-api.ts +++ b/packages/taler-integrationtests/src/test-bank-api.ts @@ -17,7 +17,21 @@  /**   * Imports.   */ -import { runTest, GlobalTestState, MerchantPrivateApi, WalletCli, defaultCoinConfig, ExchangeService, setupDb, BankService, MerchantService, BankApi, BankUser, BankAccessApi, CreditDebitIndicator } from "./harness"; +import { +  runTest, +  GlobalTestState, +  MerchantPrivateApi, +  WalletCli, +  defaultCoinConfig, +  ExchangeService, +  setupDb, +  BankService, +  MerchantService, +  BankApi, +  BankUser, +  BankAccessApi, +  CreditDebitIndicator, +} from "./harness";  import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers";  import { createEddsaKeyPair, encodeCrock } from "taler-wallet-core"; diff --git a/packages/taler-integrationtests/src/test-exchange-management.ts b/packages/taler-integrationtests/src/test-exchange-management.ts index 7da260978..81d2efb78 100644 --- a/packages/taler-integrationtests/src/test-exchange-management.ts +++ b/packages/taler-integrationtests/src/test-exchange-management.ts @@ -234,7 +234,11 @@ runTest(async (t: GlobalTestState) => {    // Create withdrawal operation    const user = await BankApi.createRandomBankUser(bank); -  const wop = await BankAccessApi.createWithdrawalOperation(bank, user, "TESTKUDOS:10"); +  const wop = await BankAccessApi.createWithdrawalOperation( +    bank, +    user, +    "TESTKUDOS:10", +  );    // Hand it to the wallet diff --git a/packages/taler-integrationtests/src/test-merchant-longpolling.ts b/packages/taler-integrationtests/src/test-merchant-longpolling.ts index 1470cadfe..5189d247e 100644 --- a/packages/taler-integrationtests/src/test-merchant-longpolling.ts +++ b/packages/taler-integrationtests/src/test-merchant-longpolling.ts @@ -47,7 +47,7 @@ runTest(async (t: GlobalTestState) => {    /**     * =========================================================================     * Create an order and let the wallet pay under a session ID -   *  +   *     * We check along the way that the JSON response to /orders/{order_id}     * returns the right thing.     * ========================================================================= diff --git a/packages/taler-integrationtests/src/test-pay-paid.ts b/packages/taler-integrationtests/src/test-pay-paid.ts index eb58fce30..61e8ce80f 100644 --- a/packages/taler-integrationtests/src/test-pay-paid.ts +++ b/packages/taler-integrationtests/src/test-pay-paid.ts @@ -18,7 +18,11 @@   * Imports.   */  import { runTest, GlobalTestState, MerchantPrivateApi } from "./harness"; -import { createSimpleTestkudosEnvironment, withdrawViaBank, createFaultInjectedMerchantTestkudosEnvironment } from "./helpers"; +import { +  createSimpleTestkudosEnvironment, +  withdrawViaBank, +  createFaultInjectedMerchantTestkudosEnvironment, +} from "./helpers";  import {    PreparePayResultType,    codecForMerchantOrderStatusUnpaid, @@ -48,7 +52,7 @@ runTest(async (t: GlobalTestState) => {    /**     * =========================================================================     * Create an order and let the wallet pay under a session ID -   *  +   *     * We check along the way that the JSON response to /orders/{order_id}     * returns the right thing.     * ========================================================================= @@ -64,7 +68,6 @@ runTest(async (t: GlobalTestState) => {      },    }); -    let orderStatus = await MerchantPrivateApi.queryPrivateOrderStatus(merchant, {      orderId: orderResp.order_id,      sessionId: "mysession-one", @@ -159,7 +162,7 @@ runTest(async (t: GlobalTestState) => {        } else if (url.pathname.endsWith("/paid")) {          numPaidRequested++;        } -    } +    },    });    // Pay with new taler://pay URI, which should @@ -175,5 +178,4 @@ runTest(async (t: GlobalTestState) => {    // Make sure the wallet is actually doing the replay properly.    t.assertTrue(numPaidRequested == 1);    t.assertTrue(numPayRequested == 0); -  }); diff --git a/packages/taler-integrationtests/src/test-payment-claim.ts b/packages/taler-integrationtests/src/test-payment-claim.ts index 3755394fd..6aed7e9e1 100644 --- a/packages/taler-integrationtests/src/test-payment-claim.ts +++ b/packages/taler-integrationtests/src/test-payment-claim.ts @@ -102,8 +102,7 @@ runTest(async (t: GlobalTestState) => {    });    t.assertTrue( -    err.operationError.code === -      TalerErrorCode.WALLET_ORDER_ALREADY_CLAIMED, +    err.operationError.code === TalerErrorCode.WALLET_ORDER_ALREADY_CLAIMED,    );    await t.shutdown(); diff --git a/packages/taler-integrationtests/src/test-payment-fault.ts b/packages/taler-integrationtests/src/test-payment-fault.ts index 85c054575..a29c62374 100644 --- a/packages/taler-integrationtests/src/test-payment-fault.ts +++ b/packages/taler-integrationtests/src/test-payment-fault.ts @@ -117,7 +117,11 @@ runTest(async (t: GlobalTestState) => {    // Create withdrawal operation    const user = await BankApi.createRandomBankUser(bank); -  const wop = await BankAccessApi.createWithdrawalOperation(bank, user, "TESTKUDOS:20"); +  const wop = await BankAccessApi.createWithdrawalOperation( +    bank, +    user, +    "TESTKUDOS:20", +  );    // Hand it to the wallet diff --git a/packages/taler-integrationtests/src/test-payment-idempotency.ts b/packages/taler-integrationtests/src/test-payment-idempotency.ts index 6c75de6b1..85be04d59 100644 --- a/packages/taler-integrationtests/src/test-payment-idempotency.ts +++ b/packages/taler-integrationtests/src/test-payment-idempotency.ts @@ -94,7 +94,9 @@ runTest(async (t: GlobalTestState) => {      talerPayUri,    }); -  t.assertTrue(preparePayResultAfter.status === PreparePayResultType.AlreadyConfirmed); +  t.assertTrue( +    preparePayResultAfter.status === PreparePayResultType.AlreadyConfirmed, +  );    t.assertTrue(preparePayResultAfter.paid === true);    await t.shutdown(); diff --git a/packages/taler-integrationtests/src/test-payment.ts b/packages/taler-integrationtests/src/test-payment.ts index d2401e072..a099e9f23 100644 --- a/packages/taler-integrationtests/src/test-payment.ts +++ b/packages/taler-integrationtests/src/test-payment.ts @@ -17,7 +17,12 @@  /**   * Imports.   */ -import { runTest, GlobalTestState, MerchantPrivateApi, WalletCli } from "./harness"; +import { +  runTest, +  GlobalTestState, +  MerchantPrivateApi, +  WalletCli, +} from "./harness";  import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers";  import { PreparePayResultType } from "taler-wallet-core"; @@ -60,7 +65,9 @@ runTest(async (t: GlobalTestState) => {      talerPayUri: orderStatus.taler_pay_uri,    }); -  t.assertTrue(preparePayResult.status === PreparePayResultType.PaymentPossible); +  t.assertTrue( +    preparePayResult.status === PreparePayResultType.PaymentPossible, +  );    const r2 = await wallet.apiRequest("confirmPay", {      // FIXME: should be validated, don't cast! diff --git a/packages/taler-integrationtests/src/test-paywall-flow.ts b/packages/taler-integrationtests/src/test-paywall-flow.ts index c4c5784ed..350a60dde 100644 --- a/packages/taler-integrationtests/src/test-paywall-flow.ts +++ b/packages/taler-integrationtests/src/test-paywall-flow.ts @@ -46,7 +46,7 @@ runTest(async (t: GlobalTestState) => {    /**     * =========================================================================     * Create an order and let the wallet pay under a session ID -   *  +   *     * We check along the way that the JSON response to /orders/{order_id}     * returns the right thing.     * ========================================================================= @@ -220,9 +220,7 @@ runTest(async (t: GlobalTestState) => {    });    if (publicOrderStatusResp.status != 402) { -    throw Error( -      `expected status 402, but got ${publicOrderStatusResp.status}`, -    ); +    throw Error(`expected status 402, but got ${publicOrderStatusResp.status}`);    }    pubUnpaidStatus = codecForMerchantOrderStatusUnpaid().decode( diff --git a/packages/taler-integrationtests/src/test-refund-auto.ts b/packages/taler-integrationtests/src/test-refund-auto.ts index ed80c1c3f..cd688a2b1 100644 --- a/packages/taler-integrationtests/src/test-refund-auto.ts +++ b/packages/taler-integrationtests/src/test-refund-auto.ts @@ -46,7 +46,7 @@ runTest(async (t: GlobalTestState) => {        fulfillment_url: "taler://fulfillment-success/thx",        auto_refund: {          d_ms: 3000, -      } +      },      },    }); @@ -88,8 +88,8 @@ runTest(async (t: GlobalTestState) => {    // The wallet should now automatically pick up the refund.    await wallet.runUntilDone(); -   -  const transactions = await wallet.getTransactions() + +  const transactions = await wallet.getTransactions();    console.log(JSON.stringify(transactions, undefined, 2));    const transactionTypes = transactions.transactions.map((x) => x.type); diff --git a/packages/taler-integrationtests/src/test-refund-incremental.ts b/packages/taler-integrationtests/src/test-refund-incremental.ts index c3d2b7834..e823b40a1 100644 --- a/packages/taler-integrationtests/src/test-refund-incremental.ts +++ b/packages/taler-integrationtests/src/test-refund-incremental.ts @@ -17,7 +17,12 @@  /**   * Imports.   */ -import { runTest, GlobalTestState, delayMs, MerchantPrivateApi } from "./harness"; +import { +  runTest, +  GlobalTestState, +  delayMs, +  MerchantPrivateApi, +} from "./harness";  import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers";  /** diff --git a/packages/taler-integrationtests/src/test-timetravel.ts b/packages/taler-integrationtests/src/test-timetravel.ts index 086606b90..b25720c13 100644 --- a/packages/taler-integrationtests/src/test-timetravel.ts +++ b/packages/taler-integrationtests/src/test-timetravel.ts @@ -17,18 +17,13 @@  /**   * Imports.   */ -import { -  runTest, -  GlobalTestState, -  MerchantPrivateApi, -  WalletCli, -} from "./harness"; +import { runTest, GlobalTestState } from "./harness";  import {    createSimpleTestkudosEnvironment,    withdrawViaBank,    startWithdrawViaBank,  } from "./helpers"; -import { PreparePayResultType, durationMin, Duration, TransactionType } from "taler-wallet-core"; +import { Duration, TransactionType } from "taler-wallet-core";  /**   * Basic time travel test. diff --git a/packages/taler-integrationtests/src/test-wallettesting.ts b/packages/taler-integrationtests/src/test-wallettesting.ts index 5abfcfcda..a6014a88d 100644 --- a/packages/taler-integrationtests/src/test-wallettesting.ts +++ b/packages/taler-integrationtests/src/test-wallettesting.ts @@ -81,10 +81,7 @@ runTest(async (t: GlobalTestState) => {    console.log(JSON.stringify(txns, undefined, 2));    txTypes = txns.transactions.map((x) => x.type); -  t.assertDeepEqual(txTypes, [ -    "withdrawal", -    "payment", -  ]); +  t.assertDeepEqual(txTypes, ["withdrawal", "payment"]);    await t.shutdown();  }); diff --git a/packages/taler-integrationtests/src/test-withdrawal-bank-integrated.ts b/packages/taler-integrationtests/src/test-withdrawal-bank-integrated.ts index f2593c802..d54309b31 100644 --- a/packages/taler-integrationtests/src/test-withdrawal-bank-integrated.ts +++ b/packages/taler-integrationtests/src/test-withdrawal-bank-integrated.ts @@ -32,7 +32,11 @@ runTest(async (t: GlobalTestState) => {    // Create a withdrawal operation    const user = await BankApi.createRandomBankUser(bank); -  const wop = await BankAccessApi.createWithdrawalOperation(bank, user, "TESTKUDOS:10"); +  const wop = await BankAccessApi.createWithdrawalOperation( +    bank, +    user, +    "TESTKUDOS:10", +  );    // Hand it to the wallet  | 
