From b25d012e013dee34cb882de6697776abf8d90408 Mon Sep 17 00:00:00 2001 From: quotentiroler Date: Sun, 8 Feb 2026 05:00:17 -0800 Subject: [PATCH] chore: fix vitest standalone configs and update package description - vitest.live.config.ts and vitest.e2e.config.ts now extend root config - Inherits testTimeout (120s), resolve.alias, pool, setupFiles, excludes - ui/vitest.node.config.ts gets explicit 120s timeout - package.json description updated for multi-channel AI gateway - Removed unused src/utils/time-format.ts --- package.json | 2 +- src/utils/time-format.ts | 6 ------ ui/vitest.node.config.ts | 1 + vitest.e2e.config.ts | 16 +++++++--------- vitest.live.config.ts | 16 +++++++--------- 5 files changed, 16 insertions(+), 25 deletions(-) delete mode 100644 src/utils/time-format.ts diff --git a/package.json b/package.json index d63032e2dd..0487b6ac23 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "openclaw", "version": "2026.2.6-3", - "description": "WhatsApp gateway CLI (Baileys web) with Pi RPC agent", + "description": "Multi-channel AI gateway with extensible messaging integrations", "keywords": [], "license": "MIT", "author": "", diff --git a/src/utils/time-format.ts b/src/utils/time-format.ts deleted file mode 100644 index 6ec8777623..0000000000 --- a/src/utils/time-format.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { formatRelativeTimestamp } from "../infra/format-time/format-relative.ts"; - -/** Delegates to centralized formatRelativeTimestamp with date fallback for >7d. */ -export function formatRelativeTime(timestamp: number): string { - return formatRelativeTimestamp(timestamp, { dateFallback: true, fallback: "unknown" }); -} diff --git a/ui/vitest.node.config.ts b/ui/vitest.node.config.ts index 0522e88e03..e71ff10823 100644 --- a/ui/vitest.node.config.ts +++ b/ui/vitest.node.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from "vitest/config"; // Node-only tests for pure logic (no Playwright/browser dependency). export default defineConfig({ test: { + testTimeout: 120_000, include: ["src/**/*.node.test.ts"], environment: "node", }, diff --git a/vitest.e2e.config.ts b/vitest.e2e.config.ts index 0bb8248782..6bb3d7ecd6 100644 --- a/vitest.e2e.config.ts +++ b/vitest.e2e.config.ts @@ -1,22 +1,20 @@ import os from "node:os"; import { defineConfig } from "vitest/config"; +import baseConfig from "./vitest.config.ts"; const isCI = process.env.CI === "true" || process.env.GITHUB_ACTIONS === "true"; const cpuCount = os.cpus().length; const e2eWorkers = isCI ? 2 : Math.min(4, Math.max(1, Math.floor(cpuCount * 0.25))); +const baseTest = (baseConfig as { test?: { exclude?: string[] } }).test ?? {}; +const exclude = baseTest.exclude ?? []; + export default defineConfig({ + ...baseConfig, test: { - pool: "forks", + ...baseTest, maxWorkers: e2eWorkers, include: ["test/**/*.e2e.test.ts", "src/**/*.e2e.test.ts"], - setupFiles: ["test/setup.ts"], - exclude: [ - "dist/**", - "apps/macos/**", - "apps/macos/.build/**", - "**/vendor/**", - "dist/OpenClaw.app/**", - ], + exclude, }, }); diff --git a/vitest.live.config.ts b/vitest.live.config.ts index 8c5b826fa8..dfd02c2ce6 100644 --- a/vitest.live.config.ts +++ b/vitest.live.config.ts @@ -1,17 +1,15 @@ import { defineConfig } from "vitest/config"; +import baseConfig from "./vitest.config.ts"; + +const baseTest = (baseConfig as { test?: { exclude?: string[] } }).test ?? {}; +const exclude = baseTest.exclude ?? []; export default defineConfig({ + ...baseConfig, test: { - pool: "forks", + ...baseTest, maxWorkers: 1, include: ["src/**/*.live.test.ts"], - setupFiles: ["test/setup.ts"], - exclude: [ - "dist/**", - "apps/macos/**", - "apps/macos/.build/**", - "**/vendor/**", - "dist/OpenClaw.app/**", - ], + exclude, }, });