style(tests): format imports
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import fs from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import fs from "node:fs/promises";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import fs from "node:fs/promises";
|
||||
import { type AddressInfo, createServer } from "node:net";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { type AddressInfo, createServer } from "node:net";
|
||||
import { describe, expect, test, vi } from "vitest";
|
||||
import { WebSocket } from "ws";
|
||||
import { agentCommand } from "../commands/agent.js";
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
export class GatewayLockError extends Error {
|
||||
constructor(message: string, public readonly cause?: unknown) {
|
||||
constructor(
|
||||
message: string,
|
||||
public readonly cause?: unknown,
|
||||
) {
|
||||
super(message);
|
||||
this.name = "GatewayLockError";
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import os from "node:os";
|
||||
import path from "node:path";
|
||||
import sharp from "sharp";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import { getReplyFromConfig } from "../auto-reply/reply.js";
|
||||
import type { ClawdisConfig } from "../config/config.js";
|
||||
import { resetLogger, setLoggerOverride } from "../logging.js";
|
||||
import * as commandQueue from "../process/command-queue.js";
|
||||
@@ -18,7 +18,6 @@ import {
|
||||
runWebHeartbeatOnce,
|
||||
stripHeartbeatToken,
|
||||
} from "./auto-reply.js";
|
||||
import { getReplyFromConfig } from "../auto-reply/reply.js";
|
||||
import type { sendMessageWhatsApp } from "./outbound.js";
|
||||
import {
|
||||
resetBaileysMocks,
|
||||
@@ -565,7 +564,10 @@ describe("web auto-reply", () => {
|
||||
await run;
|
||||
});
|
||||
|
||||
it("stops after hitting max reconnect attempts", { timeout: 20000 }, async () => {
|
||||
it(
|
||||
"stops after hitting max reconnect attempts",
|
||||
{ timeout: 20000 },
|
||||
async () => {
|
||||
const closeResolvers: Array<() => void> = [];
|
||||
const sleep = vi.fn(async () => {});
|
||||
const listenerFactory = vi.fn(async () => {
|
||||
@@ -606,7 +608,8 @@ describe("web auto-reply", () => {
|
||||
expect(runtime.error).toHaveBeenCalledWith(
|
||||
expect.stringContaining("max attempts reached"),
|
||||
);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
it("skips reply heartbeat when requests are running", async () => {
|
||||
const tmpDir = await fs.mkdtemp(
|
||||
|
||||
@@ -553,7 +553,7 @@ describe("web monitor inbox", () => {
|
||||
await listener.close();
|
||||
});
|
||||
});
|
||||
it("defaults to self-only when no config is present", async () => {
|
||||
it("defaults to self-only when no config is present", async () => {
|
||||
// No config file => allowFrom should be derived from selfE164
|
||||
mockLoadConfig.mockReturnValue({});
|
||||
|
||||
@@ -566,7 +566,11 @@ describe("web monitor inbox", () => {
|
||||
type: "notify",
|
||||
messages: [
|
||||
{
|
||||
key: { id: "no-config-1", fromMe: false, remoteJid: "999@s.whatsapp.net" },
|
||||
key: {
|
||||
id: "no-config-1",
|
||||
fromMe: false,
|
||||
remoteJid: "999@s.whatsapp.net",
|
||||
},
|
||||
message: { conversation: "ping" },
|
||||
messageTimestamp: 1_700_000_000,
|
||||
},
|
||||
@@ -582,7 +586,11 @@ describe("web monitor inbox", () => {
|
||||
type: "notify",
|
||||
messages: [
|
||||
{
|
||||
key: { id: "no-config-2", fromMe: false, remoteJid: "123@s.whatsapp.net" },
|
||||
key: {
|
||||
id: "no-config-2",
|
||||
fromMe: false,
|
||||
remoteJid: "123@s.whatsapp.net",
|
||||
},
|
||||
message: { conversation: "self ping" },
|
||||
messageTimestamp: 1_700_000_001,
|
||||
},
|
||||
@@ -608,4 +616,4 @@ describe("web monitor inbox", () => {
|
||||
});
|
||||
|
||||
await listener.close();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user