From 32f01e3e328db0006a55c6324625b49d60244b66 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 28 Feb 2026 15:16:20 -0800 Subject: fix typescript issues --- test/integration/ark-reconcile.test.ts | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'test/integration/ark-reconcile.test.ts') 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 => { 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 => { 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 -- cgit v1.2.3