refactor: trim shared test helper exports · openclaw/openclaw@442f595
steipete
·
2026-05-01
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,7 +3,7 @@ import { afterEach, beforeEach, vi } from "vitest";
|
3 | 3 | import * as ssrf from "../infra/net/ssrf.js"; |
4 | 4 | import { withFetchPreconnect } from "../test-utils/fetch-mock.js"; |
5 | 5 | |
6 | | -export function resolveRequestUrl(input: RequestInfo | URL): string { |
| 6 | +function resolveRequestUrl(input: RequestInfo | URL): string { |
7 | 7 | if (typeof input === "string") { |
8 | 8 | return input; |
9 | 9 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -33,7 +33,7 @@ export function makePrivateQaSourceRoot(tempDirs: string[], prefix: string): str
|
33 | 33 | return sourceRoot; |
34 | 34 | } |
35 | 35 | |
36 | | -export function makeQaRuntimeSurface() { |
| 36 | +function makeQaRuntimeSurface() { |
37 | 37 | return { |
38 | 38 | defaultQaRuntimeModelForMode: vi.fn(), |
39 | 39 | startQaLiveLaneGateway: vi.fn(), |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -20,7 +20,7 @@ export function createBundleMcpTempHarness() {
|
20 | 20 | }; |
21 | 21 | } |
22 | 22 | |
23 | | -export function resolveBundlePluginRoot(homeDir: string, pluginId: string) { |
| 23 | +function resolveBundlePluginRoot(homeDir: string, pluginId: string) { |
24 | 24 | return path.join(homeDir, ".openclaw", "extensions", pluginId); |
25 | 25 | } |
26 | 26 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -90,7 +90,7 @@ export function addTestHook(params: {
|
90 | 90 | } as PluginHookRegistration); |
91 | 91 | } |
92 | 92 | |
93 | | -export function addTestHooks( |
| 93 | +function addTestHooks( |
94 | 94 | registry: PluginRegistry, |
95 | 95 | hooks: ReadonlyArray<{ |
96 | 96 | pluginId: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { expect } from "vitest"; |
2 | 2 | |
3 | | -export const openaiCodexCatalogEntries = [ |
| 3 | +const openaiCodexCatalogEntries = [ |
4 | 4 | { provider: "openai", id: "gpt-5.2", name: "GPT-5.2" }, |
5 | 5 | { provider: "openai", id: "gpt-5.2-pro", name: "GPT-5.2 Pro" }, |
6 | 6 | { provider: "openai", id: "gpt-5-mini", name: "GPT-5 mini" }, |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import type { PluginLoadResult } from "./loader.js"; |
2 | 2 | import type { PluginRecord } from "./registry.js"; |
3 | | -import type { PluginCompatibilityNotice, PluginStatusReport } from "./status.js"; |
| 3 | +import type { PluginCompatibilityNotice } from "./status.js"; |
4 | 4 | import type { PluginHookName } from "./types.js"; |
5 | 5 | |
6 | 6 | export const LEGACY_BEFORE_AGENT_START_MESSAGE = |
@@ -174,13 +174,3 @@ export function createPluginLoadResult(
|
174 | 174 | realtimeVoiceProviders: realtimeVoiceProviders ?? [], |
175 | 175 | }; |
176 | 176 | } |
177 | | - |
178 | | -export function createPluginStatusReport( |
179 | | -overrides: Partial<PluginStatusReport> & Pick<PluginStatusReport, "plugins">, |
180 | | -): PluginStatusReport { |
181 | | -const { workspaceDir, ...loadResultOverrides } = overrides; |
182 | | -return { |
183 | | - workspaceDir, |
184 | | - ...createPluginLoadResult(loadResultOverrides), |
185 | | -}; |
186 | | -} |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,7 +2,7 @@ import fs from "node:fs";
|
2 | 2 | import path from "node:path"; |
3 | 3 | import type { OpenClawConfig } from "../../config/types.openclaw.js"; |
4 | 4 | |
5 | | -export type ColdPluginFixture = { |
| 5 | +type ColdPluginFixture = { |
6 | 6 | authChoiceId: string; |
7 | 7 | channelId: string; |
8 | 8 | pluginId: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,7 +3,7 @@ import path from "node:path";
|
3 | 3 | |
4 | 4 | const TASK_ROOT = path.resolve(import.meta.dirname); |
5 | 5 | |
6 | | -export const TASK_BOUNDARY_SRC_ROOT = path.resolve(TASK_ROOT, ".."); |
| 6 | +const TASK_BOUNDARY_SRC_ROOT = path.resolve(TASK_ROOT, ".."); |
7 | 7 | |
8 | 8 | export function toTaskBoundaryRelativePath(file: string, root = TASK_BOUNDARY_SRC_ROOT): string { |
9 | 9 | return path.relative(root, file).replaceAll(path.sep, "/"); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,7 +3,7 @@ import type { NetworkInterfacesSnapshot } from "../infra/network-interfaces.js";
|
3 | 3 | |
4 | 4 | type NetworkInterfaceEntry = NonNullable<ReturnType<typeof os.networkInterfaces>[string]>[number]; |
5 | 5 | |
6 | | -export type NetworkInterfaceEntryInput = { |
| 6 | +type NetworkInterfaceEntryInput = { |
7 | 7 | address: string; |
8 | 8 | family: "IPv4" | "IPv6"; |
9 | 9 | internal?: boolean; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。