mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 12:50:42 +00:00
refactor: trim shared test helper exports
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ export function addTestHook(params: {
|
||||
} as PluginHookRegistration);
|
||||
}
|
||||
|
||||
export function addTestHooks(
|
||||
function addTestHooks(
|
||||
registry: PluginRegistry,
|
||||
hooks: ReadonlyArray<{
|
||||
pluginId: string;
|
||||
|
||||
@@ -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" },
|
||||
|
||||
@@ -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),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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, "/");
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user