From 56a04684c1fb77ea7b21afc6b0d2e1c4773906f6 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 11 Feb 2026 20:10:43 -0800 Subject: format --- test-ark-receive.mjs | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'test-ark-receive.mjs') diff --git a/test-ark-receive.mjs b/test-ark-receive.mjs index 44447c23..4e3fdc48 100644 --- a/test-ark-receive.mjs +++ b/test-ark-receive.mjs @@ -3,25 +3,20 @@ import { chromium } from "playwright"; const BASE = "http://172.18.0.9:3000"; const API = "http://172.18.0.12:3119"; const API_KEY = "test-playwright-key"; -const ARK_KEY = - "02b3ef049246a14b8a31e66f877dcb32be34945f270054ad97534af8e5ff75f0"; +const ARK_KEY = "02b3ef049246a14b8a31e66f877dcb32be34945f270054ad97534af8e5ff75f0"; (async () => { const browser = await chromium.launch({ headless: true }); const context = await browser.newContext({ ignoreHTTPSErrors: true }); const page = await context.newPage(); - page.on("console", (msg) => - console.log(`[browser:${msg.type()}]`, msg.text()), - ); + page.on("console", (msg) => console.log(`[browser:${msg.type()}]`, msg.text())); page.on("pageerror", (err) => console.log("[page error]", err.message)); page.on("request", (req) => { const u = req.url(); if (u.includes("ark") || u.includes("indexer") || u.includes("sync")) { - console.log( - `[req] ${req.method()} ${u} ${req.postData()?.substring(0, 500) || ""}`, - ); + console.log(`[req] ${req.method()} ${u} ${req.postData()?.substring(0, 500) || ""}`); } }); page.on("response", (resp) => { @@ -33,9 +28,7 @@ const ARK_KEY = ) { resp .text() - .then((t) => - console.log(`[resp] ${resp.status()} ${u} -> ${t.substring(0, 500)}`), - ) + .then((t) => console.log(`[resp] ${resp.status()} ${u} -> ${t.substring(0, 500)}`)) .catch(() => {}); } }); @@ -51,9 +44,7 @@ const ARK_KEY = if (h.name.toLowerCase() === "set-cookie") { const m = h.value.match(/token=([^;]+)/); if (m) - await context.addCookies([ - { name: "token", value: m[1], domain: "172.18.0.9", path: "/" }, - ]); + await context.addCookies([{ name: "token", value: m[1], domain: "172.18.0.9", path: "/" }]); } } @@ -76,9 +67,7 @@ const ARK_KEY = console.log("\n--- Checking accounts ---"); const acctResp = await page.request.get(`${API}/accounts`, { headers: { - cookie: (await context.cookies()) - .map((c) => `${c.name}=${c.value}`) - .join("; "), + cookie: (await context.cookies()).map((c) => `${c.name}=${c.value}`).join("; "), }, }); const accounts = await acctResp.json(); @@ -93,9 +82,7 @@ const ARK_KEY = console.log("\n--- Checking payments ---"); const payResp = await page.request.get(`${API}/payments`, { headers: { - cookie: (await context.cookies()) - .map((c) => `${c.name}=${c.value}`) - .join("; "), + cookie: (await context.cookies()).map((c) => `${c.name}=${c.value}`).join("; "), }, }); const payments = await payResp.json(); -- cgit v1.2.3