refactor: eliminate jscpd clones and boost tests

This commit is contained in:
Peter Steinberger
2026-02-19 14:59:36 +00:00
parent 71983716ff
commit dcd592a601
16 changed files with 408 additions and 235 deletions

View File

@@ -2,6 +2,7 @@ import { afterAll, beforeAll, describe, expect, test, vi } from "vitest";
import type { ChannelPlugin } from "../channels/plugins/types.js";
import type { PluginRegistry } from "../plugins/registry.js";
import { setActivePluginRegistry } from "../plugins/runtime.js";
import { createChannelTestPluginBase } from "../test-utils/channel-plugins.js";
import { createRegistry } from "./server.e2e-registry-helpers.js";
import {
connectOk,
@@ -48,20 +49,11 @@ const createStubChannelPlugin = (params: {
summary?: Record<string, unknown>;
logoutCleared?: boolean;
}): ChannelPlugin => ({
id: params.id,
meta: {
...createChannelTestPluginBase({
id: params.id,
label: params.label,
selectionLabel: params.label,
docsPath: `/channels/${params.id}`,
blurb: "test stub.",
},
capabilities: { chatTypes: ["direct"] },
config: {
listAccountIds: () => ["default"],
resolveAccount: () => ({}),
isConfigured: async () => false,
},
config: { isConfigured: async () => false },
}),
status: {
buildChannelSummary: async () => ({
configured: false,