Docs: voice overlay plan and fix web mocks
This commit is contained in:
@@ -6,6 +6,7 @@ import { getReplyFromConfig } from "./reply.js";
|
||||
const webMocks = vi.hoisted(() => ({
|
||||
webAuthExists: vi.fn().mockResolvedValue(true),
|
||||
getWebAuthAgeMs: vi.fn().mockReturnValue(120_000),
|
||||
readWebSelfId: vi.fn().mockReturnValue({ e164: "+1999" }),
|
||||
}));
|
||||
|
||||
vi.mock("../web/session.js", () => webMocks);
|
||||
|
||||
@@ -7,6 +7,7 @@ const mocks = vi.hoisted(() => ({
|
||||
resolveStorePath: vi.fn().mockReturnValue("/tmp/sessions.json"),
|
||||
webAuthExists: vi.fn().mockResolvedValue(true),
|
||||
getWebAuthAgeMs: vi.fn().mockReturnValue(5000),
|
||||
readWebSelfId: vi.fn().mockReturnValue({ e164: "+1999" }),
|
||||
logWebSelfId: vi.fn(),
|
||||
}));
|
||||
|
||||
@@ -17,6 +18,7 @@ vi.mock("../config/sessions.js", () => ({
|
||||
vi.mock("../web/session.js", () => ({
|
||||
webAuthExists: mocks.webAuthExists,
|
||||
getWebAuthAgeMs: mocks.getWebAuthAgeMs,
|
||||
readWebSelfId: mocks.readWebSelfId,
|
||||
logWebSelfId: mocks.logWebSelfId,
|
||||
}));
|
||||
vi.mock("../config/config.js", () => ({
|
||||
|
||||
@@ -179,7 +179,9 @@ export async function startControlChannel(
|
||||
respond(undefined, false, `unknown method: ${parsed.method}`);
|
||||
break;
|
||||
}
|
||||
logDebug(`control: ${parsed.method} responded in ${Date.now() - started}ms`);
|
||||
logDebug(
|
||||
`control: ${parsed.method} responded in ${Date.now() - started}ms`,
|
||||
);
|
||||
} catch (err) {
|
||||
logError(
|
||||
`control: ${parsed.method} failed in ${Date.now() - started}ms: ${String(err)}`,
|
||||
|
||||
Reference in New Issue
Block a user