From 5fd85c71ca97a7b1db8e41fa3865f9e391be43ad Mon Sep 17 00:00:00 2001 From: vorotamoroz Date: Fri, 22 May 2026 03:20:28 +0000 Subject: [PATCH] test: chore: prettify --- src/apps/cli/testdeno/bench-couchdb.ts | 18 ++++++++++-------- src/apps/cli/testdeno/bench-p2p.ts | 8 ++++++-- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/apps/cli/testdeno/bench-couchdb.ts b/src/apps/cli/testdeno/bench-couchdb.ts index 678b236..6ed6df7 100644 --- a/src/apps/cli/testdeno/bench-couchdb.ts +++ b/src/apps/cli/testdeno/bench-couchdb.ts @@ -120,11 +120,7 @@ type ProxyHandle = { note: string; }; -function startCouchdbProxy(options: { - backendUri: string; - proxyUri: string; - requestedRttMs: number; -}): ProxyHandle { +function startCouchdbProxy(options: { backendUri: string; proxyUri: string; requestedRttMs: number }): ProxyHandle { const backend = new URL(options.backendUri); const proxy = new URL(options.proxyUri); const halfDelayMs = Math.max(1, Math.floor(options.requestedRttMs / 2)); @@ -261,7 +257,11 @@ async function main(): Promise { for (const sample of sampleFiles) { const pulledPath = workDir.join(`pulled-${sample.relativePath.split("/").join("_")}`); await runCliOrFail(vaultB, "--settings", settingsB, "pull", sample.relativePath, pulledPath); - await assertFilesEqual(sample.absolutePath, pulledPath, `sample file mismatch after CouchDB sync: ${sample.relativePath}`); + await assertFilesEqual( + sample.absolutePath, + pulledPath, + `sample file mismatch after CouchDB sync: ${sample.relativePath}` + ); } const result = { @@ -283,7 +283,9 @@ async function main(): Promise { syncBElapsedMs: Number(syncBElapsed.toFixed(1)), totalSyncElapsedMs: Number((syncAElapsed + syncBElapsed).toFixed(1)), throughputBytesPerSec: Number((seedFiles.totalBytes / ((syncAElapsed + syncBElapsed) / 1000)).toFixed(2)), - throughputMiBPerSec: Number((seedFiles.totalBytes / ((syncAElapsed + syncBElapsed) / 1000) / 1024 / 1024).toFixed(4)), + throughputMiBPerSec: Number( + (seedFiles.totalBytes / ((syncAElapsed + syncBElapsed) / 1000) / 1024 / 1024).toFixed(4) + ), }; if (resultPath) { @@ -307,4 +309,4 @@ if (import.meta.main) { console.error(`[Fatal Error]`, error); Deno.exit(1); }); -} \ No newline at end of file +} diff --git a/src/apps/cli/testdeno/bench-p2p.ts b/src/apps/cli/testdeno/bench-p2p.ts index 40be30a..cbc920f 100644 --- a/src/apps/cli/testdeno/bench-p2p.ts +++ b/src/apps/cli/testdeno/bench-p2p.ts @@ -171,7 +171,11 @@ async function main(): Promise { for (const sample of sampleFiles) { const pulledPath = workDir.join(`pulled-${sample.relativePath.replaceAll("/", "_")}`); await runCliOrFail(clientVault, "--settings", clientSettings, "pull", sample.relativePath, pulledPath); - await assertFilesEqual(sample.absolutePath, pulledPath, `sample file mismatch after sync: ${sample.relativePath}`); + await assertFilesEqual( + sample.absolutePath, + pulledPath, + `sample file mismatch after sync: ${sample.relativePath}` + ); } const result = { @@ -216,4 +220,4 @@ if (import.meta.main) { console.error(`[Fatal Error]`, error); Deno.exit(1); }); -} \ No newline at end of file +}