mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 16:38:27 +00:00
test(web): import auto-reply after mocks
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import { describe, expect, it, vi } from "vitest";
|
import { beforeAll, describe, expect, it, vi } from "vitest";
|
||||||
import { escapeRegExp, formatEnvelopeTimestamp } from "../../test/helpers/envelope-timestamp.js";
|
import { escapeRegExp, formatEnvelopeTimestamp } from "../../test/helpers/envelope-timestamp.js";
|
||||||
import { monitorWebChannel } from "./auto-reply.js";
|
|
||||||
import {
|
import {
|
||||||
installWebAutoReplyTestHomeHooks,
|
installWebAutoReplyTestHomeHooks,
|
||||||
installWebAutoReplyUnitTestHooks,
|
installWebAutoReplyUnitTestHooks,
|
||||||
@@ -13,6 +12,12 @@ installWebAutoReplyTestHomeHooks();
|
|||||||
describe("web auto-reply", () => {
|
describe("web auto-reply", () => {
|
||||||
installWebAutoReplyUnitTestHooks();
|
installWebAutoReplyUnitTestHooks();
|
||||||
|
|
||||||
|
// Ensure test-harness `vi.mock(...)` hooks are registered before importing the module under test.
|
||||||
|
let monitorWebChannel: typeof import("./auto-reply.js").monitorWebChannel;
|
||||||
|
beforeAll(async () => {
|
||||||
|
({ monitorWebChannel } = await import("./auto-reply.js"));
|
||||||
|
});
|
||||||
|
|
||||||
it("handles helper envelope timestamps with trimmed timezones (regression)", () => {
|
it("handles helper envelope timestamps with trimmed timezones (regression)", () => {
|
||||||
const d = new Date("2025-01-01T00:00:00.000Z");
|
const d = new Date("2025-01-01T00:00:00.000Z");
|
||||||
expect(() => formatEnvelopeTimestamp(d, " America/Los_Angeles ")).not.toThrow();
|
expect(() => formatEnvelopeTimestamp(d, " America/Los_Angeles ")).not.toThrow();
|
||||||
|
|||||||
Reference in New Issue
Block a user