quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

commit 205b8382c3e4916381b3818eb40270c986e92ef0
parent 71ca00645ca9eeed9944f1aa1d53a0586937d083
Author: Florian Dold <florian@dold.me>
Date:   Fri, 20 Jun 2025 22:00:43 +0200

tests

Diffstat:
Mtests/test_wallet_export.js | 18++++++++++++------
Atests/test_wallet_import.js | 23+++++++++++++++++++++++
2 files changed, 35 insertions(+), 6 deletions(-)

diff --git a/tests/test_wallet_export.js b/tests/test_wallet_export.js @@ -15,9 +15,15 @@ const initResp = await wallet.client.call(talerWalletCore.WalletApiOperation.Ini console.log(j2s(initResp)); -const exportResp = await wallet.client.call(talerWalletCore.WalletApiOperation.ExportDbToFile, { - directory: "/tmp", - stem: "taler-wallet-export", - forceFormat: "json", -}); - +try { + const exportResp = await wallet.client.call(talerWalletCore.WalletApiOperation.ExportDbToFile, { + directory: "/tmp", + stem: "taler-wallet-export", + forceFormat: "json", + }); +} catch (e) { + console.log("caught e"); +} + + +await wallet.client.call(talerWalletCore.WalletApiOperation.Shutdown, {}); diff --git a/tests/test_wallet_import.js b/tests/test_wallet_import.js @@ -0,0 +1,23 @@ +import * as tart from "tart"; + +const { talerUtilHttp, talerWalletCore, talerUtil } = talerModules; + +const { j2s } = talerUtil; + +const httpLib = talerUtilHttp.createPlatformHttpLib(); + +const { wallet } = await talerWalletCore.createNativeWalletHost2({ + httpLib, +}); + + +const initResp = await wallet.client.call(talerWalletCore.WalletApiOperation.InitWallet, {}); + +console.log(j2s(initResp)); + +const exportResp = await wallet.client.call(talerWalletCore.WalletApiOperation.ImportDbFromFile, { + path: "/tmp/taler-wallet-export.json", +}); + + +await wallet.client.call(talerWalletCore.WalletApiOperation.Shutdown, {});