mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-27 21:08:00 +00:00
Set up Vitest with node polyfills and add 338 tests across 18 test files covering the MCP tools, API layer, Redux state, selectors, and update manager. Fix shallow-copy bug in ensureUser that caused shared state between Redux user entries. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
44 lines
980 B
TypeScript
44 lines
980 B
TypeScript
import { defineConfig } from "vitest/config";
|
|
import { nodePolyfills } from "vite-plugin-node-polyfills";
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
nodePolyfills({
|
|
include: ["buffer", "process", "util", "os", "crypto", "stream"],
|
|
globals: {
|
|
Buffer: true,
|
|
process: true,
|
|
global: true,
|
|
},
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
buffer: "buffer",
|
|
process: "process/browser",
|
|
util: "util",
|
|
os: "os-browserify/browser",
|
|
},
|
|
},
|
|
test: {
|
|
globals: true,
|
|
environment: "node",
|
|
mockReset: true,
|
|
restoreMocks: true,
|
|
setupFiles: ["src/__tests__/setup.ts"],
|
|
include: ["src/**/*.test.ts"],
|
|
hookTimeout: 30000,
|
|
testTimeout: 30000,
|
|
coverage: {
|
|
provider: "v8",
|
|
include: [
|
|
"src/lib/mcp/**",
|
|
"src/store/telegram/**",
|
|
"src/services/updateManager.ts",
|
|
"src/services/messageLoader.ts",
|
|
],
|
|
reporter: ["text", "html"],
|
|
},
|
|
},
|
|
});
|