test: trim gateway fixture sizes and preload message command

This commit is contained in:
Peter Steinberger
2026-02-22 14:50:02 +00:00
parent 8cc744ef1f
commit b6ac0eef5d
3 changed files with 20 additions and 31 deletions

View File

@@ -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",