revert deno test

This commit is contained in:
vorotamoroz
2026-06-17 06:08:40 +01:00
parent 2d5cdccf7d
commit 7895336189
9 changed files with 11 additions and 20 deletions
@@ -1,6 +1,5 @@
import { CLI_DIR, TEE_ENABLED, formatTeeCommand, createLineTeeWriter } from "./cli.ts";
import { join } from "@std/path";
import { compatGlobal } from "@lib/common/coreEnvFunctions.ts";
const CLI_DIST = join(CLI_DIR, "dist", "index.cjs");
const VERBOSE_ENABLED = Deno.env.get("LIVESYNC_CLI_VERBOSE") === "1";
@@ -79,7 +78,7 @@ export class BackgroundCliProcess {
const status = await Promise.race([
this.child.status.then((s) => ({ type: "status" as const, status: s })),
new Promise<{ type: "tick" }>((resolve) =>
compatGlobal.setTimeout(() => resolve({ type: "tick" }), 100)
setTimeout(() => resolve({ type: "tick" }), 100)
),
]);
if (status.type === "status") {
+1 -2
View File
@@ -1,5 +1,4 @@
import { join } from "@std/path";
import { compatGlobal } from "@lib/common/coreEnvFunctions.ts";
// ---------------------------------------------------------------------------
// Path resolution
@@ -26,7 +25,7 @@ const VERBOSE_ENABLED = Deno.env.get("LIVESYNC_CLI_VERBOSE") === "1";
const DEBUG_ENABLED = Deno.env.get("LIVESYNC_CLI_DEBUG") === "1";
function sleep(ms: number): Promise<void> {
return new Promise((resolve) => compatGlobal.setTimeout(resolve, ms));
return new Promise((resolve) => setTimeout(resolve, ms));
}
function concatChunks(chunks: Uint8Array[]): Uint8Array {
+1 -3
View File
@@ -1,5 +1,3 @@
import { compatGlobal } from "@lib/common/coreEnvFunctions.ts";
/**
* Docker service management for tests.
*
@@ -258,7 +256,7 @@ function untrackContainer(container: string): void {
}
function sleep(ms: number): Promise<void> {
return new Promise((resolve) => compatGlobal.setTimeout(resolve, ms));
return new Promise((resolve) => setTimeout(resolve, ms));
}
async function waitForCouchdbStable(hostname: string, user: string, password: string): Promise<void> {
+3 -5
View File
@@ -1,5 +1,3 @@
import { compatGlobal } from "@lib/common/coreEnvFunctions.ts";
type WaitForPortOptions = {
timeoutMs?: number;
intervalMs?: number;
@@ -7,7 +5,7 @@ type WaitForPortOptions = {
};
function sleep(ms: number): Promise<void> {
return new Promise((resolve) => compatGlobal.setTimeout(resolve, ms));
return new Promise((resolve) => setTimeout(resolve, ms));
}
async function connectWithTimeout(hostname: string, port: number, timeoutMs: number): Promise<void> {
@@ -15,13 +13,13 @@ async function connectWithTimeout(hostname: string, port: number, timeoutMs: num
try {
const connPromise = Deno.connect({ hostname, port });
const timeoutPromise = new Promise<never>((_, reject) => {
timer = compatGlobal.setTimeout(() => reject(new Error(`connect timeout after ${timeoutMs}ms`)), timeoutMs);
timer = setTimeout(() => reject(new Error(`connect timeout after ${timeoutMs}ms`)), timeoutMs);
});
const conn = await Promise.race([connPromise, timeoutPromise]);
conn.close();
} finally {
if (timer !== undefined) {
compatGlobal.clearTimeout(timer);
clearTimeout(timer);
}
}
}
+1 -2
View File
@@ -1,7 +1,6 @@
import { runCli } from "./cli.ts";
import { isLocalP2pRelay, startP2pRelay, stopP2pRelay, startCoturn, stopCoturn } from "./docker.ts";
import { waitForPort } from "./net.ts";
import { compatGlobal } from "@lib/common/coreEnvFunctions.ts";
export type PeerEntry = {
id: string;
@@ -9,7 +8,7 @@ export type PeerEntry = {
};
function sleep(ms: number): Promise<void> {
return new Promise((resolve) => compatGlobal.setTimeout(resolve, ms));
return new Promise((resolve) => setTimeout(resolve, ms));
}
function parseRelayEndpoint(relay: string): { hostname: string; port: number } {