refactor: trim shared test helper exports

This commit is contained in:
Peter Steinberger
2026-05-01 13:46:56 +01:00
parent 7e8d95b413
commit 442f59508e
9 changed files with 9 additions and 19 deletions

View File

@@ -3,7 +3,7 @@ import { afterEach, beforeEach, vi } from "vitest";
import * as ssrf from "../infra/net/ssrf.js";
import { withFetchPreconnect } from "../test-utils/fetch-mock.js";
export function resolveRequestUrl(input: RequestInfo | URL): string {
function resolveRequestUrl(input: RequestInfo | URL): string {
if (typeof input === "string") {
return input;
}

View File

@@ -33,7 +33,7 @@ export function makePrivateQaSourceRoot(tempDirs: string[], prefix: string): str
return sourceRoot;
}
export function makeQaRuntimeSurface() {
function makeQaRuntimeSurface() {
return {
defaultQaRuntimeModelForMode: vi.fn(),
startQaLiveLaneGateway: vi.fn(),

View File

@@ -20,7 +20,7 @@ export function createBundleMcpTempHarness() {
};
}
export function resolveBundlePluginRoot(homeDir: string, pluginId: string) {
function resolveBundlePluginRoot(homeDir: string, pluginId: string) {
return path.join(homeDir, ".openclaw", "extensions", pluginId);
}

View File

@@ -90,7 +90,7 @@ export function addTestHook(params: {
} as PluginHookRegistration);
}
export function addTestHooks(
function addTestHooks(
registry: PluginRegistry,
hooks: ReadonlyArray<{
pluginId: string;

View File

@@ -1,6 +1,6 @@
import { expect } from "vitest";
export const openaiCodexCatalogEntries = [
const openaiCodexCatalogEntries = [
{ provider: "openai", id: "gpt-5.2", name: "GPT-5.2" },
{ provider: "openai", id: "gpt-5.2-pro", name: "GPT-5.2 Pro" },
{ provider: "openai", id: "gpt-5-mini", name: "GPT-5 mini" },

View File

@@ -1,6 +1,6 @@
import type { PluginLoadResult } from "./loader.js";
import type { PluginRecord } from "./registry.js";
import type { PluginCompatibilityNotice, PluginStatusReport } from "./status.js";
import type { PluginCompatibilityNotice } from "./status.js";
import type { PluginHookName } from "./types.js";
export const LEGACY_BEFORE_AGENT_START_MESSAGE =
@@ -174,13 +174,3 @@ export function createPluginLoadResult(
realtimeVoiceProviders: realtimeVoiceProviders ?? [],
};
}
export function createPluginStatusReport(
overrides: Partial<PluginStatusReport> & Pick<PluginStatusReport, "plugins">,
): PluginStatusReport {
const { workspaceDir, ...loadResultOverrides } = overrides;
return {
workspaceDir,
...createPluginLoadResult(loadResultOverrides),
};
}

View File

@@ -2,7 +2,7 @@ import fs from "node:fs";
import path from "node:path";
import type { OpenClawConfig } from "../../config/types.openclaw.js";
export type ColdPluginFixture = {
type ColdPluginFixture = {
authChoiceId: string;
channelId: string;
pluginId: string;

View File

@@ -3,7 +3,7 @@ import path from "node:path";
const TASK_ROOT = path.resolve(import.meta.dirname);
export const TASK_BOUNDARY_SRC_ROOT = path.resolve(TASK_ROOT, "..");
const TASK_BOUNDARY_SRC_ROOT = path.resolve(TASK_ROOT, "..");
export function toTaskBoundaryRelativePath(file: string, root = TASK_BOUNDARY_SRC_ROOT): string {
return path.relative(root, file).replaceAll(path.sep, "/");

View File

@@ -3,7 +3,7 @@ import type { NetworkInterfacesSnapshot } from "../infra/network-interfaces.js";
type NetworkInterfaceEntry = NonNullable<ReturnType<typeof os.networkInterfaces>[string]>[number];
export type NetworkInterfaceEntryInput = {
type NetworkInterfaceEntryInput = {
address: string;
family: "IPv4" | "IPv6";
internal?: boolean;