aboutsummaryrefslogtreecommitdiffstats
path: root/test/integration/ark-reconcile.test.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-02-28 15:16:20 -0800
committerAdam Soltys <[email protected]>2026-02-28 15:16:20 -0800
commit32f01e3e328db0006a55c6324625b49d60244b66 (patch)
treeb97866549b919964957365e1e05681e85af7021a /test/integration/ark-reconcile.test.ts
parenta1632ae402d11fdd7ffc360de97c55e0b4fad677 (diff)
downloadcoinos-server-32f01e3e328db0006a55c6324625b49d60244b66.tar.gz
coinos-server-32f01e3e328db0006a55c6324625b49d60244b66.zip
fix typescript issues
Diffstat (limited to 'test/integration/ark-reconcile.test.ts')
-rw-r--r--test/integration/ark-reconcile.test.ts21
1 files changed, 5 insertions, 16 deletions
diff --git a/test/integration/ark-reconcile.test.ts b/test/integration/ark-reconcile.test.ts
index 84825475..342d02a6 100644
--- a/test/integration/ark-reconcile.test.ts
+++ b/test/integration/ark-reconcile.test.ts
@@ -8,7 +8,7 @@ import { describe, test, expect, beforeAll } from "bun:test";
const APP = "http://localhost:3119";
-const api = async (path: string, token: string, opts: any = {}) => {
+const api = async (path: string, token: string, opts: any = {}): Promise<any> => {
const res = await fetch(`${APP}${path}`, {
headers: {
"Content-Type": "application/json",
@@ -17,28 +17,19 @@ const api = async (path: string, token: string, opts: any = {}) => {
},
...opts,
});
- return res.json();
+ return res.json() as any;
};
-const register = async (username: string, password: string) => {
+const register = async (username: string, password: string): Promise<any> => {
const res = await fetch(`${APP}/register`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ user: { username, password } }),
});
if (!res.ok) throw new Error(`register failed: ${await res.text()}`);
- return res.json();
+ return res.json() as any;
};
-const login = async (username: string, password: string) => {
- const res = await fetch(`${APP}/login`, {
- method: "POST",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify({ username, password }),
- });
- if (!res.ok) throw new Error(`login failed: ${await res.text()}`);
- return res.json();
-};
const createInvoice = (token: string, invoice: any) =>
api("/invoice", token, {
@@ -46,8 +37,6 @@ const createInvoice = (token: string, invoice: any) =>
body: JSON.stringify({ invoice }),
});
-const getPayments = (token: string, aid?: string) =>
- api(`/payments${aid ? `?aid=${aid}` : ""}`, token);
// =====================================================================
// Test state
@@ -79,7 +68,7 @@ beforeAll(async () => {
body: JSON.stringify({ type: "ark", name: "ark vault" }),
});
if (res.ok) {
- const account = await res.json();
+ const account = await res.json() as any;
arkAccountId = account.id;
} else {
// Fallback: use user's own ID as the account