aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-12-07 15:36:56 +0100
committerFlorian Dold <florian@dold.me>2022-12-07 15:36:56 +0100
commit0c19050ae76d85fa7da43ef5239dc1d6f0bb6a4d (patch)
tree97ae63993ca8ecb7188d3b426f0364252b85b456
parenta1c5f00aedb75e5e2deb6b12c3cfb06eefb355e4 (diff)
wallet: add 'env-full' test environment with merchant
-rw-r--r--packages/taler-wallet-cli/src/index.ts13
-rw-r--r--packages/taler-wallet-embedded/src/wallet-qjs.ts18
2 files changed, 31 insertions, 0 deletions
diff --git a/packages/taler-wallet-cli/src/index.ts b/packages/taler-wallet-cli/src/index.ts
index dfc0f6fea..40f2273a7 100644
--- a/packages/taler-wallet-cli/src/index.ts
+++ b/packages/taler-wallet-cli/src/index.ts
@@ -68,6 +68,7 @@ import { runEnv1 } from "./env1.js";
import { GlobalTestState, runTestWithState } from "./harness/harness.js";
import { getTestInfo, runTests } from "./integrationtests/testrunner.js";
import { lintExchangeDeployment } from "./lint.js";
+import { runEnvFull } from "./env-full.js";
// @ts-ignore
global.TextEncoder = TextEncoder;
// @ts-ignore
@@ -910,6 +911,18 @@ advancedCli
});
advancedCli
+ .subcommand("envFull", "env-full", {
+ help: "Run a test environment for bench1",
+ })
+ .action(async (args) => {
+ const testDir = fs.mkdtempSync(path.join(os.tmpdir(), "taler-env-full-"));
+ const testState = new GlobalTestState({
+ testDir,
+ });
+ await runTestWithState(testState, runEnvFull, "env-full", true);
+ });
+
+advancedCli
.subcommand("env1", "env1", {
help: "Run a test environment for bench1",
})
diff --git a/packages/taler-wallet-embedded/src/wallet-qjs.ts b/packages/taler-wallet-embedded/src/wallet-qjs.ts
index cad8b68bf..8cad653a8 100644
--- a/packages/taler-wallet-embedded/src/wallet-qjs.ts
+++ b/packages/taler-wallet-embedded/src/wallet-qjs.ts
@@ -422,5 +422,23 @@ export async function testWithGv() {
});
}
+export async function testWithLocal() {
+ const w = await getWallet();
+ await w.wallet.client.call(WalletApiOperation.InitWallet, {});
+ await w.wallet.client.call(WalletApiOperation.RunIntegrationTest, {
+ amountToSpend: "TESTKUDOS:1",
+ amountToWithdraw: "TESTKUDOS:3",
+ bankBaseUrl: "http://localhost:8082/",
+ bankAccessApiBaseUrl: "http://localhost:8082/taler-bank-access/",
+ exchangeBaseUrl: "http://localhost:8081/",
+ merchantBaseUrl: "http://backend.demo.taler.net:8083/",
+ });
+ await w.wallet.runTaskLoop({
+ stopWhenDone: true,
+ });
+}
+
// @ts-ignore
globalThis.testWithGv = testWithGv;
+// @ts-ignore
+globalThis.testWithLocal = testWithLocal;