mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 02:21:25 +00:00
test: trim gateway fixture sizes and preload message command
This commit is contained in:
@@ -8,7 +8,6 @@ import type { CliDeps } from "../cli/deps.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { createTestRegistry } from "../test-utils/channel-plugins.js";
|
||||
import { captureEnv } from "../test-utils/env.js";
|
||||
const loadMessageCommand = async () => await import("./message.js");
|
||||
|
||||
let testConfig: Record<string, unknown> = {};
|
||||
vi.mock("../config/config.js", async (importOriginal) => {
|
||||
@@ -158,6 +157,8 @@ const createTelegramSendPluginRegistration = () => ({
|
||||
}),
|
||||
});
|
||||
|
||||
const { messageCommand } = await import("./message.js");
|
||||
|
||||
describe("messageCommand", () => {
|
||||
it("defaults channel when only one configured", async () => {
|
||||
process.env.TELEGRAM_BOT_TOKEN = "token-abc";
|
||||
@@ -169,7 +170,6 @@ describe("messageCommand", () => {
|
||||
]),
|
||||
);
|
||||
const deps = makeDeps();
|
||||
const { messageCommand } = await loadMessageCommand();
|
||||
await messageCommand(
|
||||
{
|
||||
target: "123456",
|
||||
@@ -195,7 +195,6 @@ describe("messageCommand", () => {
|
||||
]),
|
||||
);
|
||||
const deps = makeDeps();
|
||||
const { messageCommand } = await loadMessageCommand();
|
||||
await expect(
|
||||
messageCommand(
|
||||
{
|
||||
@@ -226,7 +225,6 @@ describe("messageCommand", () => {
|
||||
]),
|
||||
);
|
||||
const deps = makeDeps();
|
||||
const { messageCommand } = await loadMessageCommand();
|
||||
await messageCommand(
|
||||
{
|
||||
action: "send",
|
||||
@@ -249,7 +247,6 @@ describe("messageCommand", () => {
|
||||
]),
|
||||
);
|
||||
const deps = makeDeps();
|
||||
const { messageCommand } = await loadMessageCommand();
|
||||
await messageCommand(
|
||||
{
|
||||
action: "poll",
|
||||
|
||||
Reference in New Issue
Block a user