mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
docs: document channel plugin tests
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// Account action gate tests cover channel account action visibility and enablement checks.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { createAccountActionGate } from "./account-action-gate.js";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Account helper tests cover channel account normalization and lookup helpers.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import { normalizeAccountId } from "../../routing/session-key.js";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ACP binding tests cover channel plugin ACP target binding and stateful driver behavior.
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { buildConfiguredAcpSessionKey } from "../../acp/persistent-bindings.types.js";
|
||||
import { ensureConfiguredBindingBuiltinsRegistered } from "./configured-binding-builtins.js";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// ACP stateful target driver tests cover ACP target state persistence and routing.
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
const resetMocks = vi.hoisted(() => ({
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Approval tests cover channel plugin approval request formatting and dispatch.
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { resolveChannelApprovalAdapter, resolveChannelApprovalCapability } from "./approvals.js";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Binding routing tests cover channel binding selection and message routing behavior.
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import {
|
||||
testing,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Binding target tests cover channel binding target extraction and validation.
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import {
|
||||
ensureConfiguredBindingTargetReady,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Bundled load error tests cover diagnostics when bundled channel plugins fail to load.
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { describeBundledChannelLoadError } from "./bundled.js";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Bundled root cache tests cover cached bundled channel root resolution.
|
||||
import fs from "node:fs";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Bundled shape guard tests cover bundled channel package metadata and export shape.
|
||||
import { spawnSync } from "node:child_process";
|
||||
import fs from "node:fs";
|
||||
import os from "node:os";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Channel plugin catalog tests cover plugin catalog entries and metadata normalization.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { getChannelPluginCatalogEntry } from "./catalog.js";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Chat target prefix tests cover channel target prefix parsing and display behavior.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
createAllowedChatSenderMatcher,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Config helper tests cover channel plugin config merge and selection helpers.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { clearAccountEntryFields } from "./config-helpers.js";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Config schema tests cover channel plugin config schema validation and defaults.
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { z } from "zod";
|
||||
import {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Configured state tests cover channel plugin configured-state detection and summaries.
|
||||
import { createRequire } from "node:module";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Directory adapter tests cover channel directory adapter contracts and result normalization.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
createChannelDirectoryAdapter,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Directory config helper tests cover config helpers for channel directory integrations.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
createInspectedDirectoryEntriesLister,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Doctor contract API fast-path tests cover lightweight channel doctor contract loading.
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
const { loadBundledPluginPublicArtifactModuleSyncMock } = vi.hoisted(() => ({
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Gateway auth bypass tests cover channel plugin paths allowed to skip gateway auth.
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
const { loadBundledPluginPublicArtifactModuleSyncMock } = vi.hoisted(() => ({
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Group policy warning tests cover user-facing warnings for channel group access policy.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { OpenClawConfig } from "../../config/types.openclaw.js";
|
||||
import {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Channel plugin helper tests cover shared plugin helper behavior and edge cases.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Legacy config tests cover channel plugin config compatibility and migration helpers.
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { LegacyConfigRule } from "../../config/legacy.shared.js";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Message action security tests cover channel message action authorization and validation.
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { jsonResult } from "../../agents/tools/common.js";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Message action tests cover channel message action schema and invocation behavior.
|
||||
import { Type } from "typebox";
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Message capability matrix tests cover channel message feature support across plugin surfaces.
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import type { ChannelMessageActionAdapter, ChannelPlugin } from "./types.js";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Message tool API tests cover channel message tool descriptors and runtime calls.
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
const { loadBundledPluginPublicArtifactModuleSyncMock } = vi.hoisted(() => ({
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Module loader tests cover channel plugin module resolution and import failure handling.
|
||||
import fs from "node:fs";
|
||||
import { createRequire } from "node:module";
|
||||
import os from "node:os";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Package state probe tests cover channel plugin package install and runtime status probes.
|
||||
import fs from "node:fs";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Pairing adapter tests cover channel plugin device/account pairing adapter behavior.
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import {
|
||||
createLoggedPairingApprovalNotifier,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Persisted auth state tests cover channel plugin auth state serialization and recovery.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
hasBundledChannelPersistedAuthState,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Read-only command default tests cover command defaulting for read-only channel plugins.
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
const loadPluginMetadataSnapshot = vi.hoisted(() => vi.fn());
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Read-only channel tests cover read-only plugin registration and runtime behavior.
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath, pathToFileURL } from "node:url";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Registry tests cover channel plugin registry installation, lookup, and reset behavior.
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import { createEmptyPluginRegistry } from "../../plugins/registry-empty.js";
|
||||
import type { PluginRegistry } from "../../plugins/registry.js";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Runtime forwarder tests cover channel plugin runtime method delegation and fallback handling.
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import {
|
||||
createRuntimeDirectoryLiveAdapter,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Session conversation fallback tests cover bundled plugin fallback for conversation sessions.
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { clearRuntimeConfigSnapshot, setRuntimeConfigSnapshot } from "../../config/io.js";
|
||||
import { resetPluginRuntimeStateForTest } from "../../plugins/runtime.js";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Session conversation tests cover channel plugin conversation binding and session lookup.
|
||||
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
||||
import { clearRuntimeConfigSnapshot, setRuntimeConfigSnapshot } from "../../config/io.js";
|
||||
import { resetPluginRuntimeStateForTest, setActivePluginRegistry } from "../../plugins/runtime.js";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Setup group access configure tests cover channel setup writes for group access config.
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import { configureChannelAccessWithAllowlist } from "./setup-group-access-configure.js";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Setup group access tests cover group access setup flow decisions and outputs.
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import {
|
||||
formatAllowlistEntries,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Setup helper import-safety tests cover lazy boundaries for channel plugin setup helpers.
|
||||
import { importFreshModule } from "openclaw/plugin-sdk/test-fixtures";
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Setup helper tests cover channel setup helper outputs and lifecycle cleanup.
|
||||
import { afterAll, beforeEach, describe, expect, it } from "vitest";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import { resetPluginRuntimeStateForTest, setActivePluginRegistry } from "../../plugins/runtime.js";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Setup promotion helper tests cover setup-result promotion into configured channel state.
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
const getBundledChannelPluginMock = vi.hoisted(() => vi.fn());
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Setup wizard binary tests cover channel setup wizard binary selection and invocation.
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import {
|
||||
createCliPathTextInput,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Setup wizard helper tests cover channel setup step formatting and config writes.
|
||||
import {
|
||||
resolveSetupWizardAllowFromEntries,
|
||||
resolveSetupWizardGroupAllowlist,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Setup wizard proxy tests cover proxying setup wizard calls through channel plugin facades.
|
||||
import {
|
||||
promptSetupWizardAllowFrom,
|
||||
resolveSetupWizardAllowFromEntries,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Target parsing tests cover channel target syntax parsing and validation.
|
||||
import { beforeEach, describe, expect, it } from "vitest";
|
||||
import {
|
||||
channelRouteTargetsMatchExact,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Target resolver tests cover channel plugin target resolution from user input and bindings.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
buildUnresolvedTargetResults,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Thread binding API tests cover channel plugin thread binding contracts and helpers.
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
const { loadBundledPluginPublicArtifactModuleSyncMock } = vi.hoisted(() => ({
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Threading helper tests cover channel thread metadata and reply-thread helper behavior.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// TTS capability tests cover channel plugin text-to-speech capability detection.
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import { createEmptyPluginRegistry } from "../../plugins/registry-empty.js";
|
||||
import { setActivePluginRegistry } from "../../plugins/runtime.js";
|
||||
|
||||
Reference in New Issue
Block a user