summaryrefslogtreecommitdiff
path: root/tests/regression.test.ts
diff options
context:
space:
mode:
authorMateusz Franik <47059999+Im-Beast@users.noreply.github.com>2024-10-16 07:55:11 +0200
committerGitHub <noreply@github.com>2024-10-16 07:55:11 +0200
commitfd7bb6ae1c27ffe5d41f3a818ee9034d9bb76138 (patch)
tree01e57a1c483370a3f023ed27d401069502694396 /tests/regression.test.ts
parent44fd5e17bbce52caf681850ac79f463d9ce6bb31 (diff)
feat: wownero typescript bindings, regression tests (#71)
* regression tests * ci: move regression_check to full_check workflow, reuse artifact build * feat: support wownero in monero.ts bindings * ci: test wownero regressions as well * extract wownero-cli as wownero * actually load wownero when specified * fix: commitUR not being a symbol in wownero
Diffstat (limited to 'tests/regression.test.ts')
-rwxr-xr-xtests/regression.test.ts39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/regression.test.ts b/tests/regression.test.ts
new file mode 100755
index 0000000..82a9f95
--- /dev/null
+++ b/tests/regression.test.ts
@@ -0,0 +1,39 @@
+import { $, createWalletViaCli, downloadCli, getMoneroC, getMoneroCTags } from "./utils.ts";
+
+const coin = Deno.env.get("COIN");
+if (coin !== "monero" && coin !== "wownero") {
+ throw new Error("COIN env var invalid or missing");
+}
+
+Deno.test(`Regression tests (${coin})`, async (t) => {
+ await Deno.remove("./tests/wallets", { recursive: true }).catch(() => {});
+ await Deno.mkdir("./tests/wallets", { recursive: true });
+
+ const tags = await getMoneroCTags();
+ const latestTag = tags[0];
+ await Promise.all([getMoneroC(coin, "next"), await getMoneroC(coin, latestTag), downloadCli(coin)]);
+
+ await t.step("Simple (next, latest, next)", async () => {
+ const walletInfo = await createWalletViaCli(coin, "dog", "sobaka");
+
+ for (const version of ["next", latestTag, "next"]) {
+ await $`deno run -A ./tests/compare.ts ${coin} ${version} ${JSON.stringify(walletInfo)}`;
+ }
+ });
+
+ await t.step("All releases sequentially (all tags in the release order, next)", async () => {
+ tags.unshift("next");
+
+ const walletInfo = await createWalletViaCli(coin, "cat", "koshka");
+
+ for (const version of tags.toReversed()) {
+ if (version !== "next" && version !== tags[0]) await getMoneroC(coin, version);
+ await $`deno run -A ./tests/compare.ts ${coin} ${version} ${JSON.stringify(walletInfo)}`;
+ }
+
+ await Deno.remove("./tests/wallets", { recursive: true }).catch(() => {});
+ });
+
+ await Deno.remove("./tests/wallets", { recursive: true }).catch(() => {});
+ await Deno.remove("./tests/libs", { recursive: true }).catch(() => {});
+});