mirror of
https://github.com/openclaw/openclaw.git
synced 2026-02-19 18:39:20 -05:00
* 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 * chore: filter inherited excludes in live/e2e vitest configs * refactor: dedupe GroupPolicy/DmPolicy in extensions Import from openclaw/plugin-sdk instead of re-declaring identical types.
21 lines
670 B
TypeScript
21 lines
670 B
TypeScript
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 ?? []).filter((p) => p !== "**/*.e2e.test.ts");
|
|
|
|
export default defineConfig({
|
|
...baseConfig,
|
|
test: {
|
|
...baseTest,
|
|
maxWorkers: e2eWorkers,
|
|
include: ["test/**/*.e2e.test.ts", "src/**/*.e2e.test.ts"],
|
|
exclude,
|
|
},
|
|
});
|