mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-23 23:22:32 +00:00
test: stabilize vitest mocks and harness typing
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import fs from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { monitorWebChannel } from "./auto-reply.js";
|
||||
import { beforeAll, describe, expect, it, vi } from "vitest";
|
||||
import {
|
||||
installWebAutoReplyTestHomeHooks,
|
||||
installWebAutoReplyUnitTestHooks,
|
||||
@@ -13,6 +12,12 @@ import {
|
||||
|
||||
installWebAutoReplyTestHomeHooks();
|
||||
|
||||
let monitorWebChannel: typeof import("./auto-reply.js").monitorWebChannel;
|
||||
|
||||
beforeAll(async () => {
|
||||
({ monitorWebChannel } = await import("./auto-reply.js"));
|
||||
});
|
||||
|
||||
describe("web auto-reply", () => {
|
||||
installWebAutoReplyUnitTestHooks();
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import crypto from "node:crypto";
|
||||
import fs from "node:fs/promises";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { beforeAll, describe, expect, it, vi } from "vitest";
|
||||
import { expectInboundContextContract } from "../../test/helpers/inbound-contract.js";
|
||||
import { setLoggerOverride } from "../logging.js";
|
||||
import { monitorWebChannel, SILENT_REPLY_TOKEN } from "./auto-reply.js";
|
||||
import {
|
||||
installWebAutoReplyTestHomeHooks,
|
||||
installWebAutoReplyUnitTestHooks,
|
||||
@@ -14,6 +13,13 @@ import {
|
||||
|
||||
installWebAutoReplyTestHomeHooks();
|
||||
|
||||
let monitorWebChannel: typeof import("./auto-reply.js").monitorWebChannel;
|
||||
let SILENT_REPLY_TOKEN: typeof import("./auto-reply.js").SILENT_REPLY_TOKEN;
|
||||
|
||||
beforeAll(async () => {
|
||||
({ monitorWebChannel, SILENT_REPLY_TOKEN } = await import("./auto-reply.js"));
|
||||
});
|
||||
|
||||
describe("web auto-reply", () => {
|
||||
installWebAutoReplyUnitTestHooks();
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { monitorWebChannel } from "./auto-reply.js";
|
||||
import { beforeAll, describe, expect, it, vi } from "vitest";
|
||||
import {
|
||||
installWebAutoReplyTestHomeHooks,
|
||||
installWebAutoReplyUnitTestHooks,
|
||||
@@ -9,6 +8,12 @@ import {
|
||||
|
||||
installWebAutoReplyTestHomeHooks();
|
||||
|
||||
let monitorWebChannel: typeof import("./auto-reply.js").monitorWebChannel;
|
||||
|
||||
beforeAll(async () => {
|
||||
({ monitorWebChannel } = await import("./auto-reply.js"));
|
||||
});
|
||||
|
||||
describe("web auto-reply", () => {
|
||||
installWebAutoReplyUnitTestHooks();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user