mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 19:50:22 +00:00
fix(matrix): reduce extension test import churn
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Command } from "commander";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { formatZonedTimestamp } from "../runtime-api.js";
|
||||
import { formatZonedTimestamp } from "openclaw/plugin-sdk/matrix-runtime-shared";
|
||||
import { registerMatrixCli, resetMatrixCliStateForTests } from "./cli.js";
|
||||
|
||||
const bootstrapMatrixVerificationMock = vi.fn();
|
||||
const getMatrixRoomKeyBackupStatusMock = vi.fn();
|
||||
@@ -72,8 +73,6 @@ vi.mock("./runtime.js", () => ({
|
||||
}),
|
||||
}));
|
||||
|
||||
let registerMatrixCli: typeof import("./cli.js").registerMatrixCli;
|
||||
|
||||
function buildProgram(): Command {
|
||||
const program = new Command();
|
||||
registerMatrixCli({ program });
|
||||
@@ -112,9 +111,8 @@ function mockMatrixVerificationStatus(params: {
|
||||
}
|
||||
|
||||
describe("matrix CLI verification commands", () => {
|
||||
beforeEach(async () => {
|
||||
vi.resetModules();
|
||||
({ registerMatrixCli } = await import("./cli.js"));
|
||||
beforeEach(() => {
|
||||
resetMatrixCliStateForTests();
|
||||
vi.clearAllMocks();
|
||||
process.exitCode = undefined;
|
||||
vi.spyOn(console, "log").mockImplementation((...args: unknown[]) => consoleLogMock(...args));
|
||||
|
||||
Reference in New Issue
Block a user