diff options
Diffstat (limited to 'packages/taler-wallet-core/src/operations/testing.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/testing.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/operations/testing.ts b/packages/taler-wallet-core/src/operations/testing.ts index ece71439c..77e218cd7 100644 --- a/packages/taler-wallet-core/src/operations/testing.ts +++ b/packages/taler-wallet-core/src/operations/testing.ts @@ -24,6 +24,7 @@ import { Duration, IntegrationTestV2Args, Logger, + NotificationType, stringToBytes, TestPayResult, WithdrawTestBalanceRequest, @@ -64,6 +65,7 @@ import { confirmPeerPushCredit, } from "./pay-peer-push-credit.js"; import { initiatePeerPushDebit } from "./pay-peer-push-debit.js"; +import { OpenedPromise, openPromise } from "../index.js"; const logger = new Logger("operations/testing.ts"); @@ -445,6 +447,18 @@ export async function runIntegrationTest( logger.trace("integration test: all done!"); } +async function waitUntilDone(ws: InternalWalletState): Promise<void> { + let p: OpenedPromise<void> | undefined = undefined; + ws.addNotificationListener((notif) => { + if (!p) { + return; + } + if (notif.type === NotificationType.TransactionStateTransition) { + p.resolve(); + } + }); +} + export async function runIntegrationTest2( ws: InternalWalletState, args: IntegrationTestV2Args, |