test: chore: prettify

This commit is contained in:
vorotamoroz
2026-05-22 03:20:28 +00:00
parent c1f41910c4
commit 5fd85c71ca
2 changed files with 16 additions and 10 deletions

View File

@@ -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<void> {
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<void> {
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);
});
}
}

View File

@@ -171,7 +171,11 @@ async function main(): Promise<void> {
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);
});
}
}