test: keep hook and slack tests on public boundaries

This commit is contained in:
Peter Steinberger
2026-04-22 19:09:11 +01:00
parent 86667d670e
commit 6488e0dd0c
3 changed files with 26 additions and 13 deletions

View File

@@ -1,20 +1,16 @@
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { deliverOutboundPayloads } from "../../../src/infra/outbound/deliver.js";
import {
initializeGlobalHookRunner,
resetGlobalHookRunner,
} from "../../../src/plugins/hook-runner-global.js";
import { addTestHook } from "../../../src/plugins/hooks.test-helpers.js";
import { createEmptyPluginRegistry } from "../../../src/plugins/registry.js";
import {
releasePinnedPluginChannelRegistry,
setActivePluginRegistry,
} from "../../../src/plugins/runtime.js";
import type { PluginHookRegistration } from "../../../src/plugins/types.js";
import {
addTestHook,
createEmptyPluginRegistry,
createOutboundTestPlugin,
createTestRegistry,
} from "../../../src/test-utils/channel-plugins.js";
deliverOutboundPayloads,
initializeGlobalHookRunner,
releasePinnedPluginChannelRegistry,
resetGlobalHookRunner,
setActivePluginRegistry,
type PluginHookRegistration,
} from "../../../test/helpers/plugins/outbound-delivery.js";
import { slackOutbound } from "./outbound-adapter.js";
import type { OpenClawConfig } from "./runtime-api.js";

View File

@@ -143,6 +143,7 @@ describe("message hook mappers", () => {
from: "demo-chat:user:123",
content: "commands-body",
timestamp: 1710000000,
threadId: 42,
metadata: expect.objectContaining({
messageId: "msg-1",
senderName: "User One",

View File

@@ -0,0 +1,16 @@
export { deliverOutboundPayloads } from "../../../src/infra/outbound/deliver.js";
export {
initializeGlobalHookRunner,
resetGlobalHookRunner,
} from "../../../src/plugins/hook-runner-global.js";
export { addTestHook } from "../../../src/plugins/hooks.test-helpers.js";
export { createEmptyPluginRegistry } from "../../../src/plugins/registry.js";
export {
releasePinnedPluginChannelRegistry,
setActivePluginRegistry,
} from "../../../src/plugins/runtime.js";
export type { PluginHookRegistration } from "../../../src/plugins/types.js";
export {
createOutboundTestPlugin,
createTestRegistry,
} from "../../../src/test-utils/channel-plugins.js";