mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 02:51:24 +00:00
test: harden mock order and shell path coverage
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import { beforeEach, describe, expect, it } from "vitest";
|
||||
import { setDefaultChannelPluginRegistryForTests } from "./channel-test-helpers.js";
|
||||
import { channelsAddCommand } from "./channels.js";
|
||||
import { configMocks, offsetMocks } from "./channels.mock-harness.js";
|
||||
import { baseConfigSnapshot, createTestRuntime } from "./test-runtime-config-helpers.js";
|
||||
|
||||
const runtime = createTestRuntime();
|
||||
let channelsAddCommand: typeof import("./channels.js").channelsAddCommand;
|
||||
|
||||
describe("channelsAddCommand", () => {
|
||||
beforeEach(() => {
|
||||
beforeEach(async () => {
|
||||
configMocks.readConfigFileSnapshot.mockReset();
|
||||
configMocks.writeConfigFile.mockClear();
|
||||
offsetMocks.deleteTelegramUpdateOffset.mockClear();
|
||||
@@ -15,6 +15,7 @@ describe("channelsAddCommand", () => {
|
||||
runtime.error.mockClear();
|
||||
runtime.exit.mockClear();
|
||||
setDefaultChannelPluginRegistryForTests();
|
||||
({ channelsAddCommand } = await import("./channels.js"));
|
||||
});
|
||||
|
||||
it("clears telegram update offsets when the token changes", async () => {
|
||||
|
||||
Reference in New Issue
Block a user