mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-20 22:40:58 +00:00
test(ci): trim thread lane harness churn
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import { setActivePluginRegistry } from "../../plugins/runtime.js";
|
||||
import { createOutboundTestPlugin, createTestRegistry } from "../../test-utils/channel-plugins.js";
|
||||
@@ -77,9 +77,11 @@ function expectSuccessfulWhatsAppInternalHookPayload(
|
||||
}
|
||||
|
||||
describe("deliverOutboundPayloads lifecycle", () => {
|
||||
beforeEach(async () => {
|
||||
vi.resetModules();
|
||||
beforeAll(async () => {
|
||||
({ deliverOutboundPayloads } = await import("./deliver.js"));
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
resetDeliverTestState();
|
||||
resetDeliverTestMocks({ includeSessionMocks: true });
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { completeSimple, type AssistantMessage } from "@mariozechner/pi-ai";
|
||||
import { describe, expect, it, vi, beforeEach } from "vitest";
|
||||
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { ensureCustomApiRegistered } from "../agents/custom-api-registry.js";
|
||||
import { getApiKeyForModel } from "../agents/model-auth.js";
|
||||
import { resolveModelAsync } from "../agents/pi-embedded-runner/model.js";
|
||||
@@ -374,8 +374,7 @@ describe("tts", () => {
|
||||
messages: { tts: {} },
|
||||
};
|
||||
|
||||
beforeEach(async () => {
|
||||
vi.resetModules();
|
||||
beforeAll(async () => {
|
||||
({ completeSimple: completeSimpleForTest } = await import("@mariozechner/pi-ai"));
|
||||
({ getApiKeyForModel: getApiKeyForModelForTest } = await import("../agents/model-auth.js"));
|
||||
({ resolveModelAsync: resolveModelAsyncForTest } =
|
||||
@@ -385,6 +384,9 @@ describe("tts", () => {
|
||||
const ttsModule = await import("./tts.js");
|
||||
summarizeTextForTest = ttsModule._test.summarizeText;
|
||||
resolveTtsConfigForTest = ttsModule.resolveTtsConfig;
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
vi.mocked(completeSimpleForTest).mockResolvedValue(
|
||||
mockAssistantMessage([{ type: "text", text: "Summary" }]),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user