diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-09-04 15:28:19 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-09-04 15:28:19 +0200 |
commit | 5c809c3d9b458a47313a25e300d3c34e5700678a (patch) | |
tree | d384ceeb30fb34f51506e4750424e15c778b0f30 /src/headless | |
parent | 604a74007d559258e6630144a6293c351735d15d (diff) | |
download | wallet-core-5c809c3d9b458a47313a25e300d3c34e5700678a.tar.xz |
wait for refreshes to finish before exiting integration test
Diffstat (limited to 'src/headless')
-rw-r--r-- | src/headless/integrationtest.ts | 3 | ||||
-rw-r--r-- | src/headless/taler-wallet-cli.ts | 34 |
2 files changed, 23 insertions, 14 deletions
diff --git a/src/headless/integrationtest.ts b/src/headless/integrationtest.ts index 3b0069c21..3e60d418a 100644 --- a/src/headless/integrationtest.ts +++ b/src/headless/integrationtest.ts @@ -83,5 +83,8 @@ export async function runIntegrationTest(args: { throw Error("payment did not succeed"); } + const refreshRes = await myWallet.refreshDirtyCoins(); + console.log(`waited to refresh ${refreshRes.numRefreshed} coins`); + myWallet.stop(); } diff --git a/src/headless/taler-wallet-cli.ts b/src/headless/taler-wallet-cli.ts index f10346369..ef9030fe5 100644 --- a/src/headless/taler-wallet-cli.ts +++ b/src/headless/taler-wallet-cli.ts @@ -301,25 +301,31 @@ program "amount to withdraw", "TESTKUDOS:10", ) - .option("-s, --spend-amount <spend-amt>", "amount to spend", "TESTKUDOS:5") + .option("-s, --spend-amount <spend-amt>", "amount to spend", "TESTKUDOS:4") .description("Run integration test with bank, exchange and merchant.") .action(async cmdObj => { applyVerbose(program.verbose); - await runIntegrationTest({ - amountToSpend: cmdObj.spendAmount, - amountToWithdraw: cmdObj.withdrawAmount, - bankBaseUrl: cmdObj.bank, - exchangeBaseUrl: cmdObj.exchange, - merchantApiKey: cmdObj.merchantApiKey, - merchantBaseUrl: cmdObj.merchant, - merchantInstance: cmdObj.merchantInstance, - }).catch(err => { - console.error("Failed with exception:"); - console.error(err); - }); + try { + await runIntegrationTest({ + amountToSpend: cmdObj.spendAmount, + amountToWithdraw: cmdObj.withdrawAmount, + bankBaseUrl: cmdObj.bank, + exchangeBaseUrl: cmdObj.exchange, + merchantApiKey: cmdObj.merchantApiKey, + merchantBaseUrl: cmdObj.merchant, + merchantInstance: cmdObj.merchantInstance, + }).catch(err => { + console.error("Failed with exception:"); + console.error(err); + }); + + process.exit(0); + } catch (e) { + console.error(e); + process.exit(1); + } - process.exit(0); }); // error on unknown commands |