From d563101a82fd75f00f2b83c3110e69913c46cb7a Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Tue, 7 Jul 2026 13:45:26 -0700 Subject: [PATCH] refactor(deadcode): localize test and tooling helpers (#101875) --- scripts/github/dependency-guard.mjs | 2 +- scripts/github/real-behavior-proof-policy.mjs | 4 ++-- scripts/lib/codex-app-server-protocol-source.ts | 4 ++-- scripts/lib/gateway-bench-probes.ts | 2 +- scripts/lib/openclaw-test-state.mjs | 6 +++--- scripts/lib/plugin-npm-release.ts | 2 +- scripts/lib/plugin-npm-runtime-build.mjs | 6 +++--- test/e2e/qa-lab/config/cli-channel-picker.ts | 2 +- test/e2e/qa-lab/media/hosted-media-provider-live.ts | 2 +- test/e2e/qa-lab/plugins/plugin-lifecycle-probe-runtime.ts | 2 +- test/e2e/qa-lab/runtime/docker-artifact-proof.ts | 2 +- test/e2e/qa-lab/runtime/gateway-mcp-real-transports.ts | 2 +- test/e2e/qa-lab/runtime/media-talk-gateway.ts | 2 +- test/e2e/qa-lab/runtime/voice-call-gateway.ts | 2 +- test/helpers/agents/prompt-composition-scenarios.ts | 2 +- test/helpers/auto-reply/trigger-handling-test-harness.ts | 6 +++--- test/vitest/vitest.boundary.config.ts | 2 +- test/vitest/vitest.contracts-shared.ts | 2 +- test/vitest/vitest.extension-active-memory.config.ts | 2 +- test/vitest/vitest.extension-clickclack.config.ts | 2 +- ...itest.extension-codex-app-server-attempt-extra.config.ts | 2 +- ...itest.extension-codex-app-server-attempt-light.config.ts | 2 +- ...est.extension-codex-app-server-attempt-support.config.ts | 2 +- .../vitest.extension-codex-app-server-attempt.config.ts | 2 +- .../vitest.extension-codex-app-server-runtime.config.ts | 2 +- .../vitest.extension-codex-app-server-support.config.ts | 2 +- .../vitest.extension-codex-app-server-tools.config.ts | 2 +- test/vitest/vitest.extension-codex-surface.config.ts | 2 +- test/vitest/vitest.extension-codex.config.ts | 4 +--- test/vitest/vitest.gateway-client.config.ts | 2 +- test/vitest/vitest.gateway-core.config.ts | 2 +- test/vitest/vitest.gateway-methods.config.ts | 2 +- test/vitest/vitest.gateway-server.config.ts | 2 +- test/vitest/vitest.gateway.config.ts | 2 +- test/vitest/vitest.pattern-file.ts | 2 +- test/vitest/vitest.scoped-config.ts | 5 +---- test/vitest/vitest.tui-pty.config.ts | 2 +- test/vitest/vitest.ui-e2e.config.ts | 2 +- ui/src/test-helpers/chat-model.ts | 4 +--- 39 files changed, 47 insertions(+), 54 deletions(-) diff --git a/scripts/github/dependency-guard.mjs b/scripts/github/dependency-guard.mjs index 879edf8fc7ab..52365015300f 100644 --- a/scripts/github/dependency-guard.mjs +++ b/scripts/github/dependency-guard.mjs @@ -253,7 +253,7 @@ export function isDependencyGuardMarkerComment(comment, marker, trustedAuthors) return Boolean(login && trustedAuthors.has(login) && comment.body?.includes(marker)); } -export function renderDependencyAwarenessComment(dependencyFiles) { +function renderDependencyAwarenessComment(dependencyFiles) { const listedFiles = dependencyFiles.slice(0, maxListedFiles); const omittedCount = dependencyFiles.length - listedFiles.length; const fileLines = listedFiles.map((filename) => `- ${markdownCode(filename)}`); diff --git a/scripts/github/real-behavior-proof-policy.mjs b/scripts/github/real-behavior-proof-policy.mjs index 2871edb91801..f67b458113e8 100644 --- a/scripts/github/real-behavior-proof-policy.mjs +++ b/scripts/github/real-behavior-proof-policy.mjs @@ -66,7 +66,7 @@ function createTooLargeGitHubApiBodyError(label, maxBytes) { return error; } -export async function withGitHubApiTimeout(label, timeoutMs, run) { +async function withGitHubApiTimeout(label, timeoutMs, run) { const boundedTimeoutMs = Math.max(1, timeoutMs); const controller = new AbortController(); const timeoutError = createTimeoutError(label, boundedTimeoutMs); @@ -168,7 +168,7 @@ function isAutomationUser(user = {}, fallbackLogin = "") { return user?.type === "Bot" || /\[bot\]$/i.test(login) || login.startsWith("app/"); } -export function isExternalPullRequest(pullRequest) { +function isExternalPullRequest(pullRequest) { if (!pullRequest) { return false; } diff --git a/scripts/lib/codex-app-server-protocol-source.ts b/scripts/lib/codex-app-server-protocol-source.ts index ab4a4a66f6cc..89598f4bdbee 100644 --- a/scripts/lib/codex-app-server-protocol-source.ts +++ b/scripts/lib/codex-app-server-protocol-source.ts @@ -399,7 +399,7 @@ function formatGeneratedTypeScript(repoRoot: string, root: string): void { } } -export async function rewriteTypeScriptImports(root: string): Promise { +async function rewriteTypeScriptImports(root: string): Promise { const entries = await fs.readdir(root, { withFileTypes: true }); await Promise.all( entries.map(async (entry) => { @@ -417,7 +417,7 @@ export async function rewriteTypeScriptImports(root: string): Promise { ); } -export function normalizeGeneratedTypeScript(text: string): string { +function normalizeGeneratedTypeScript(text: string): string { return text .replace(/(from\s+["'])(\.{1,2}\/[^"']+?)(\.js)?(["'])/g, "$1$2.js$4") .replace('export * as v2 from "./v2.js";', 'export * as v2 from "./v2/index.js";') diff --git a/scripts/lib/gateway-bench-probes.ts b/scripts/lib/gateway-bench-probes.ts index 763225d1bd0a..37c709ae5a6e 100644 --- a/scripts/lib/gateway-bench-probes.ts +++ b/scripts/lib/gateway-bench-probes.ts @@ -37,7 +37,7 @@ export async function requestProbeStatus( } } -export function classifyProbeErrorKind(error: unknown): string { +function classifyProbeErrorKind(error: unknown): string { if (typeof error === "object" && error !== null) { const code = (error as { code?: unknown }).code; if (typeof code === "string" && code.trim()) { diff --git a/scripts/lib/openclaw-test-state.mjs b/scripts/lib/openclaw-test-state.mjs index 8f45be0d7766..29aae33b78f1 100644 --- a/scripts/lib/openclaw-test-state.mjs +++ b/scripts/lib/openclaw-test-state.mjs @@ -336,12 +336,12 @@ export async function createState(options = {}) { } /** Render a dotenv-style env file for a created test state plan. */ -export function renderEnvFile(plan) { +function renderEnvFile(plan) { return `${renderExports(plan.env)}\n`; } /** Render shell commands that create and export an isolated OpenClaw test state. */ -export function renderShellSnippet(options = {}) { +function renderShellSnippet(options = {}) { const label = normalizeLabel(options.label); const scenario = requireScenario(options.scenario); const config = scenarioConfig(scenario, options); @@ -374,7 +374,7 @@ export function renderShellSnippet(options = {}) { } /** Render a reusable shell function for creating isolated OpenClaw test state. */ -export function renderShellFunction() { +function renderShellFunction() { return `openclaw_test_state_create() { local raw_label="\${1:-state}" local label="$raw_label" diff --git a/scripts/lib/plugin-npm-release.ts b/scripts/lib/plugin-npm-release.ts index 6f5bd79a3003..184a28257518 100644 --- a/scripts/lib/plugin-npm-release.ts +++ b/scripts/lib/plugin-npm-release.ts @@ -654,7 +654,7 @@ function runNpmView(args: string[]): string { } } -export function resolveNpmLatestVersion(packageName: string): string { +function resolveNpmLatestVersion(packageName: string): string { const raw = runNpmView([packageName, "dist-tags.latest", "--json"]); const parsed = JSON.parse(raw) as unknown; if (typeof parsed !== "string" || !parsed.trim()) { diff --git a/scripts/lib/plugin-npm-runtime-build.mjs b/scripts/lib/plugin-npm-runtime-build.mjs index c5b185be9e6e..cc1ca347f3b7 100644 --- a/scripts/lib/plugin-npm-runtime-build.mjs +++ b/scripts/lib/plugin-npm-runtime-build.mjs @@ -22,7 +22,7 @@ function readJsonFile(filePath) { } /** Return whether a plugin package publishes through an artifact release workflow. */ -export function isPublishablePluginPackage(packageJson) { +function isPublishablePluginPackage(packageJson) { return ( packageJson.openclaw?.release?.publishToNpm === true || packageJson.openclaw?.release?.publishToClawHub === true @@ -121,7 +121,7 @@ export function listPluginNpmRuntimeBuildOutputs(plan) { } /** Resolve package `files` entries needed for runtime build outputs and plugin metadata. */ -export function resolvePluginNpmRuntimePackageFiles(plan) { +function resolvePluginNpmRuntimePackageFiles(plan) { const merged = new Set( Array.isArray(plan.packageJson.files) ? plan.packageJson.files.filter((entry) => typeof entry === "string") @@ -167,7 +167,7 @@ function resolveOpenClawPeerRange(packageJson, rootPackageJson) { } /** Resolve package peer dependency metadata for the OpenClaw plugin API. */ -export function resolvePluginNpmRuntimePackagePeerMetadata(plan) { +function resolvePluginNpmRuntimePackagePeerMetadata(plan) { const openclawPeerRange = resolveOpenClawPeerRange(plan.packageJson, plan.rootPackageJson); if (!openclawPeerRange) { throw new Error( diff --git a/test/e2e/qa-lab/config/cli-channel-picker.ts b/test/e2e/qa-lab/config/cli-channel-picker.ts index c9fec12f82cf..0ee1b0a79276 100644 --- a/test/e2e/qa-lab/config/cli-channel-picker.ts +++ b/test/e2e/qa-lab/config/cli-channel-picker.ts @@ -244,7 +244,7 @@ function createEvidenceWriter(options: ProducerOptions) { }); } -export async function runCliChannelPickerProducer(options: ProducerOptions) { +async function runCliChannelPickerProducer(options: ProducerOptions) { const startedAt = Date.now(); const writer = createEvidenceWriter(options); const workDir = path.join(options.artifactBase, ".work"); diff --git a/test/e2e/qa-lab/media/hosted-media-provider-live.ts b/test/e2e/qa-lab/media/hosted-media-provider-live.ts index 21df3edfa618..76ef0528ed8f 100644 --- a/test/e2e/qa-lab/media/hosted-media-provider-live.ts +++ b/test/e2e/qa-lab/media/hosted-media-provider-live.ts @@ -795,7 +795,7 @@ export function buildHostedMediaEvidence(params: { return createHostedMediaEvidenceWriter(params.options).build(params.result); } -export async function runHostedMediaProviderLiveProducer( +async function runHostedMediaProviderLiveProducer( options: HostedMediaOptions, ): Promise { const writer = createHostedMediaEvidenceWriter(options); diff --git a/test/e2e/qa-lab/plugins/plugin-lifecycle-probe-runtime.ts b/test/e2e/qa-lab/plugins/plugin-lifecycle-probe-runtime.ts index 8db6526c3048..5f4e70f409e4 100644 --- a/test/e2e/qa-lab/plugins/plugin-lifecycle-probe-runtime.ts +++ b/test/e2e/qa-lab/plugins/plugin-lifecycle-probe-runtime.ts @@ -492,7 +492,7 @@ async function runMeasured( ); } -export async function runPluginLifecycleMatrix() { +async function runPluginLifecycleMatrix() { const pluginId = "lifecycle-claw"; const packageName = "@openclaw/lifecycle-claw"; const resourceDir = tempDirs.make("openclaw-plugin-lifecycle-matrix-"); diff --git a/test/e2e/qa-lab/runtime/docker-artifact-proof.ts b/test/e2e/qa-lab/runtime/docker-artifact-proof.ts index fa32ce70fb41..26a65b4d481a 100644 --- a/test/e2e/qa-lab/runtime/docker-artifact-proof.ts +++ b/test/e2e/qa-lab/runtime/docker-artifact-proof.ts @@ -159,7 +159,7 @@ async function runScheduler(options: ProducerOptions, appendLog: (chunk: unknown }); } -export async function runDockerArtifactProofProducer( +async function runDockerArtifactProofProducer( options: ProducerOptions, ): Promise { const proof = PROOFS[options.lane]; diff --git a/test/e2e/qa-lab/runtime/gateway-mcp-real-transports.ts b/test/e2e/qa-lab/runtime/gateway-mcp-real-transports.ts index 9b619cfb7712..50c9548e27c9 100644 --- a/test/e2e/qa-lab/runtime/gateway-mcp-real-transports.ts +++ b/test/e2e/qa-lab/runtime/gateway-mcp-real-transports.ts @@ -713,7 +713,7 @@ async function produceProof(options: ProducerOptions): Promise { } } -export async function runGatewayMcpRealTransportProducer( +async function runGatewayMcpRealTransportProducer( options: ProducerOptions, ): Promise { const scenario = SCENARIOS[options.scenarioId]; diff --git a/test/e2e/qa-lab/runtime/media-talk-gateway.ts b/test/e2e/qa-lab/runtime/media-talk-gateway.ts index b1bb8e1fb408..c8f66a5e0a39 100644 --- a/test/e2e/qa-lab/runtime/media-talk-gateway.ts +++ b/test/e2e/qa-lab/runtime/media-talk-gateway.ts @@ -570,7 +570,7 @@ async function produceProof(options: ProducerOptions): Promise { } } -export async function runMediaTalkGatewayProducer( +async function runMediaTalkGatewayProducer( options: ProducerOptions, ): Promise { const scenario = SCENARIOS[options.scenarioId]; diff --git a/test/e2e/qa-lab/runtime/voice-call-gateway.ts b/test/e2e/qa-lab/runtime/voice-call-gateway.ts index e9eab1e73689..8262f7ce5ffa 100644 --- a/test/e2e/qa-lab/runtime/voice-call-gateway.ts +++ b/test/e2e/qa-lab/runtime/voice-call-gateway.ts @@ -315,7 +315,7 @@ async function produceProof(options: ProducerOptions): Promise { } } -export async function runVoiceCallGatewayProducer( +async function runVoiceCallGatewayProducer( options: ProducerOptions, ): Promise { const writer = createQaScriptEvidenceWriter({ diff --git a/test/helpers/agents/prompt-composition-scenarios.ts b/test/helpers/agents/prompt-composition-scenarios.ts index 427e139ced3c..784219e5bf84 100644 --- a/test/helpers/agents/prompt-composition-scenarios.ts +++ b/test/helpers/agents/prompt-composition-scenarios.ts @@ -738,7 +738,7 @@ async function createMaintenanceScenario(workspaceDir: string): Promise { +async function createWorkspaceWithPromptCompositionFiles(): Promise { const workspaceDir = await makeTempWorkspace("openclaw-prompt-cache-"); await writeWorkspaceFile({ dir: workspaceDir, diff --git a/test/helpers/auto-reply/trigger-handling-test-harness.ts b/test/helpers/auto-reply/trigger-handling-test-harness.ts index 972692b7a493..bc63f13459fb 100644 --- a/test/helpers/auto-reply/trigger-handling-test-harness.ts +++ b/test/helpers/auto-reply/trigger-handling-test-harness.ts @@ -313,7 +313,7 @@ export function makeCfg(home: string): OpenClawConfig { } as OpenClawConfig); } -export async function loadGetReplyFromConfig() { +async function loadGetReplyFromConfig() { return (await import("../../../src/auto-reply/reply.js")).getReplyFromConfig; } @@ -399,7 +399,7 @@ export async function expectBareNewOrResetAcknowledged(params: { expect(runEmbeddedAgentMock).not.toHaveBeenCalled(); } -export function installTriggerHandlingE2eTestHooks() { +function installTriggerHandlingE2eTestHooks() { afterEach(() => { clearRuntimeAuthProfileStoreSnapshots(); vi.clearAllMocks(); @@ -418,7 +418,7 @@ export function mockRunEmbeddedAgentOk(text = "ok"): AnyMock { return runEmbeddedAgentMock; } -export function createBlockReplyCollector() { +function createBlockReplyCollector() { const blockReplies: Array<{ text?: string }> = []; return { blockReplies, diff --git a/test/vitest/vitest.boundary.config.ts b/test/vitest/vitest.boundary.config.ts index 14064ebb0e57..ca231b0c709d 100644 --- a/test/vitest/vitest.boundary.config.ts +++ b/test/vitest/vitest.boundary.config.ts @@ -5,7 +5,7 @@ import { resolveVitestIsolation } from "./vitest.scoped-config.ts"; import { nonIsolatedRunnerPath, sharedVitestConfig } from "./vitest.shared.config.ts"; import { boundaryTestFiles } from "./vitest.unit-paths.mjs"; -export function loadBoundaryIncludePatternsFromEnv( +function loadBoundaryIncludePatternsFromEnv( env: Record = process.env, ): string[] | null { return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env); diff --git a/test/vitest/vitest.contracts-shared.ts b/test/vitest/vitest.contracts-shared.ts index 13aa9e8823bd..7ab9ea8ab9b1 100644 --- a/test/vitest/vitest.contracts-shared.ts +++ b/test/vitest/vitest.contracts-shared.ts @@ -42,7 +42,7 @@ export const channelSessionContractPatterns = [ export const pluginContractPatterns = ["src/plugins/contracts/**/*.test.ts"]; -export function loadContractsIncludePatternsFromEnv( +function loadContractsIncludePatternsFromEnv( env: Record = process.env, ): string[] | null { return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env); diff --git a/test/vitest/vitest.extension-active-memory.config.ts b/test/vitest/vitest.extension-active-memory.config.ts index 0b3d2228f7a4..3a528fa1c6f3 100644 --- a/test/vitest/vitest.extension-active-memory.config.ts +++ b/test/vitest/vitest.extension-active-memory.config.ts @@ -9,7 +9,7 @@ export function loadIncludePatternsFromEnv( return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env); } -export function createExtensionActiveMemoryVitestConfig( +function createExtensionActiveMemoryVitestConfig( env: Record = process.env, ) { return createScopedVitestConfig( diff --git a/test/vitest/vitest.extension-clickclack.config.ts b/test/vitest/vitest.extension-clickclack.config.ts index e0e8b590694f..6e725ea8e534 100644 --- a/test/vitest/vitest.extension-clickclack.config.ts +++ b/test/vitest/vitest.extension-clickclack.config.ts @@ -1,7 +1,7 @@ // Vitest extension clickclack config wires the extension clickclack test shard. import { createSingleChannelExtensionVitestConfig } from "./vitest.extension-channel-single-config.ts"; -export function createExtensionClickClackVitestConfig( +function createExtensionClickClackVitestConfig( env: Record = process.env, ) { return createSingleChannelExtensionVitestConfig("clickclack", env); diff --git a/test/vitest/vitest.extension-codex-app-server-attempt-extra.config.ts b/test/vitest/vitest.extension-codex-app-server-attempt-extra.config.ts index 54f6fdfb3a04..da16ae463ba9 100644 --- a/test/vitest/vitest.extension-codex-app-server-attempt-extra.config.ts +++ b/test/vitest/vitest.extension-codex-app-server-attempt-extra.config.ts @@ -1,7 +1,7 @@ // Vitest extension codex app server attempt extra config wires the extension codex app server attempt extra test shard. import { createScopedVitestConfig } from "./vitest.scoped-config.ts"; -export function createExtensionCodexAppServerAttemptExtraVitestConfig( +function createExtensionCodexAppServerAttemptExtraVitestConfig( env: Record = process.env, ) { return createScopedVitestConfig( diff --git a/test/vitest/vitest.extension-codex-app-server-attempt-light.config.ts b/test/vitest/vitest.extension-codex-app-server-attempt-light.config.ts index c1c836de9b5f..7ff9f3d0d9b4 100644 --- a/test/vitest/vitest.extension-codex-app-server-attempt-light.config.ts +++ b/test/vitest/vitest.extension-codex-app-server-attempt-light.config.ts @@ -1,7 +1,7 @@ // Vitest extension codex app server attempt light config wires the extension codex app server attempt light test shard. import { createScopedVitestConfig } from "./vitest.scoped-config.ts"; -export function createExtensionCodexAppServerAttemptLightVitestConfig( +function createExtensionCodexAppServerAttemptLightVitestConfig( env: Record = process.env, ) { return createScopedVitestConfig( diff --git a/test/vitest/vitest.extension-codex-app-server-attempt-support.config.ts b/test/vitest/vitest.extension-codex-app-server-attempt-support.config.ts index b288db8974c4..9410825fb86f 100644 --- a/test/vitest/vitest.extension-codex-app-server-attempt-support.config.ts +++ b/test/vitest/vitest.extension-codex-app-server-attempt-support.config.ts @@ -1,7 +1,7 @@ // Vitest extension codex app server attempt support config wires the extension codex app server attempt support test shard. import { createScopedVitestConfig } from "./vitest.scoped-config.ts"; -export function createExtensionCodexAppServerAttemptSupportVitestConfig( +function createExtensionCodexAppServerAttemptSupportVitestConfig( env: Record = process.env, ) { return createScopedVitestConfig( diff --git a/test/vitest/vitest.extension-codex-app-server-attempt.config.ts b/test/vitest/vitest.extension-codex-app-server-attempt.config.ts index 7c981dc5249d..30757a2e9bd3 100644 --- a/test/vitest/vitest.extension-codex-app-server-attempt.config.ts +++ b/test/vitest/vitest.extension-codex-app-server-attempt.config.ts @@ -1,7 +1,7 @@ // Vitest extension codex app server attempt config wires the extension codex app server attempt test shard. import { createScopedVitestConfig } from "./vitest.scoped-config.ts"; -export function createExtensionCodexAppServerAttemptVitestConfig( +function createExtensionCodexAppServerAttemptVitestConfig( env: Record = process.env, ) { return createScopedVitestConfig(["extensions/codex/src/app-server/run-attempt.test.ts"], { diff --git a/test/vitest/vitest.extension-codex-app-server-runtime.config.ts b/test/vitest/vitest.extension-codex-app-server-runtime.config.ts index ee712fa105d2..0fcaca625387 100644 --- a/test/vitest/vitest.extension-codex-app-server-runtime.config.ts +++ b/test/vitest/vitest.extension-codex-app-server-runtime.config.ts @@ -1,7 +1,7 @@ // Vitest extension codex app server runtime config wires the extension codex app server runtime test shard. import { createScopedVitestConfig } from "./vitest.scoped-config.ts"; -export function createExtensionCodexAppServerRuntimeVitestConfig( +function createExtensionCodexAppServerRuntimeVitestConfig( env: Record = process.env, ) { return createScopedVitestConfig( diff --git a/test/vitest/vitest.extension-codex-app-server-support.config.ts b/test/vitest/vitest.extension-codex-app-server-support.config.ts index 3c29954641f7..a87e9318126b 100644 --- a/test/vitest/vitest.extension-codex-app-server-support.config.ts +++ b/test/vitest/vitest.extension-codex-app-server-support.config.ts @@ -35,7 +35,7 @@ const coveredAppServerPatterns = [ "extensions/codex/src/app-server/user-input-bridge.test.ts", ]; -export function createExtensionCodexAppServerSupportVitestConfig( +function createExtensionCodexAppServerSupportVitestConfig( env: Record = process.env, ) { return createScopedVitestConfig(["extensions/codex/src/app-server/**/*.test.ts"], { diff --git a/test/vitest/vitest.extension-codex-app-server-tools.config.ts b/test/vitest/vitest.extension-codex-app-server-tools.config.ts index b6f1f706beef..fda4a152d8d2 100644 --- a/test/vitest/vitest.extension-codex-app-server-tools.config.ts +++ b/test/vitest/vitest.extension-codex-app-server-tools.config.ts @@ -1,7 +1,7 @@ // Vitest extension codex app server tools config wires the extension codex app server tools test shard. import { createScopedVitestConfig } from "./vitest.scoped-config.ts"; -export function createExtensionCodexAppServerToolsVitestConfig( +function createExtensionCodexAppServerToolsVitestConfig( env: Record = process.env, ) { return createScopedVitestConfig( diff --git a/test/vitest/vitest.extension-codex-surface.config.ts b/test/vitest/vitest.extension-codex-surface.config.ts index 5084b0f177c9..7a38191507c8 100644 --- a/test/vitest/vitest.extension-codex-surface.config.ts +++ b/test/vitest/vitest.extension-codex-surface.config.ts @@ -2,7 +2,7 @@ import { codexExtensionTestRoots } from "./vitest.extension-codex-paths.mjs"; import { createScopedVitestConfig } from "./vitest.scoped-config.ts"; -export function createExtensionCodexSurfaceVitestConfig( +function createExtensionCodexSurfaceVitestConfig( env: Record = process.env, ) { return createScopedVitestConfig( diff --git a/test/vitest/vitest.extension-codex.config.ts b/test/vitest/vitest.extension-codex.config.ts index 2ff707b3abd5..eb023f0caf37 100644 --- a/test/vitest/vitest.extension-codex.config.ts +++ b/test/vitest/vitest.extension-codex.config.ts @@ -9,9 +9,7 @@ export function loadIncludePatternsFromEnv( return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env); } -export function createExtensionCodexVitestConfig( - env: Record = process.env, -) { +function createExtensionCodexVitestConfig(env: Record = process.env) { return createScopedVitestConfig( loadIncludePatternsFromEnv(env) ?? codexExtensionTestRoots.map((root) => `${root}/**/*.test.ts`), diff --git a/test/vitest/vitest.gateway-client.config.ts b/test/vitest/vitest.gateway-client.config.ts index feab8c9377d7..1aa23e00c36a 100644 --- a/test/vitest/vitest.gateway-client.config.ts +++ b/test/vitest/vitest.gateway-client.config.ts @@ -1,7 +1,7 @@ // Vitest gateway client config wires the gateway client test shard. import { createScopedVitestConfig } from "./vitest.scoped-config.ts"; -export function createGatewayClientVitestConfig(env?: Record) { +function createGatewayClientVitestConfig(env?: Record) { return createScopedVitestConfig( [ "packages/gateway-client/src/**/*.test.ts", diff --git a/test/vitest/vitest.gateway-core.config.ts b/test/vitest/vitest.gateway-core.config.ts index 235d6f2fe5dd..5db8d473bc32 100644 --- a/test/vitest/vitest.gateway-core.config.ts +++ b/test/vitest/vitest.gateway-core.config.ts @@ -19,7 +19,7 @@ const nonCoreGatewayTestExclude = [ "src/gateway/sessions-history-http.test.ts", ]; -export function createGatewayCoreVitestConfig(env?: Record) { +function createGatewayCoreVitestConfig(env?: Record) { return createScopedVitestConfig(["src/gateway/**/*.test.ts"], { dir: "src/gateway", env, diff --git a/test/vitest/vitest.gateway-methods.config.ts b/test/vitest/vitest.gateway-methods.config.ts index e27c935e5415..f12222b58fff 100644 --- a/test/vitest/vitest.gateway-methods.config.ts +++ b/test/vitest/vitest.gateway-methods.config.ts @@ -1,7 +1,7 @@ // Vitest gateway methods config wires the gateway methods test shard. import { createScopedVitestConfig } from "./vitest.scoped-config.ts"; -export function createGatewayMethodsVitestConfig(env?: Record) { +function createGatewayMethodsVitestConfig(env?: Record) { return createScopedVitestConfig(["src/gateway/server-methods/**/*.test.ts"], { dir: "src/gateway", env, diff --git a/test/vitest/vitest.gateway-server.config.ts b/test/vitest/vitest.gateway-server.config.ts index 7a8aae73adaa..9b6b44a6fc9e 100644 --- a/test/vitest/vitest.gateway-server.config.ts +++ b/test/vitest/vitest.gateway-server.config.ts @@ -9,7 +9,7 @@ const gatewayServerBackedHttpTests = [ "src/gateway/probe.auth.integration.test.ts", ]; -export function createGatewayServerVitestConfig(env?: Record) { +function createGatewayServerVitestConfig(env?: Record) { return createScopedVitestConfig( ["src/gateway/**/*server*.test.ts", ...gatewayServerBackedHttpTests], { diff --git a/test/vitest/vitest.gateway.config.ts b/test/vitest/vitest.gateway.config.ts index 320a81c4e2e1..41be572f8594 100644 --- a/test/vitest/vitest.gateway.config.ts +++ b/test/vitest/vitest.gateway.config.ts @@ -22,7 +22,7 @@ export function createGatewayVitestConfig(env?: Record pattern.replace(/^src\//u, "")) ?? null; } -export function createTuiPtyVitestConfig(env?: Record) { +function createTuiPtyVitestConfig(env?: Record) { const baseTest = sharedVitestConfig.test ?? {}; const exclude = (baseTest.exclude ?? []).filter((pattern) => pattern !== "**/*.e2e.test.ts"); const configEnv = env ?? process.env; diff --git a/test/vitest/vitest.ui-e2e.config.ts b/test/vitest/vitest.ui-e2e.config.ts index 88145b7f0fd9..45abdb6bde30 100644 --- a/test/vitest/vitest.ui-e2e.config.ts +++ b/test/vitest/vitest.ui-e2e.config.ts @@ -5,7 +5,7 @@ import { sharedVitestConfig } from "./vitest.shared.config.ts"; const uiE2eIncludePatterns = ["ui/src/**/*.e2e.test.ts"]; -export function createUiE2eVitestConfig( +function createUiE2eVitestConfig( env: Record = process.env, argv: string[] = process.argv, ) { diff --git a/ui/src/test-helpers/chat-model.ts b/ui/src/test-helpers/chat-model.ts index 18ddd24a69c1..bccc80941ac0 100644 --- a/ui/src/test-helpers/chat-model.ts +++ b/ui/src/test-helpers/chat-model.ts @@ -44,9 +44,7 @@ export function createAmbiguousModelCatalog( })); } -export function createMainSessionRow( - overrides: Partial = {}, -): GatewaySessionRow { +function createMainSessionRow(overrides: Partial = {}): GatewaySessionRow { return { key: "main", kind: "direct",