Files
obsidian-livesync/vitest.config.rpc-unit.ts
T
vorotamoroz 295dc1392a ### Fixed
- Fixed an issue where using fast synchronisation caused a TypeError in some environments (#953).
2026-06-12 11:33:07 +01:00

37 lines
1.2 KiB
TypeScript

/**
* @file vitest.config.rpc-unit.ts
* @description Configuration for running RPC-specific unit tests (such as RpcRoom and transport layers) in Node.js,
* enforcing coverage thresholds on the RPC sub-module.
* This can be run manually to verify RPC-specific coverage, or is matched by the glob patterns in `npm run test:unit`.
*/
import { defineConfig, mergeConfig } from "vitest/config";
import viteConfig from "./vitest.config.common";
export default mergeConfig(
viteConfig,
defineConfig({
resolve: {
alias: {
obsidian: "",
},
},
test: {
name: "rpc-unit-tests",
include: ["src/lib/src/rpc/**/*.unit.spec.ts"],
exclude: ["test/**"],
coverage: {
include: ["src/lib/src/rpc/**/*.ts"],
exclude: ["**/*.unit.spec.ts", "**/index.ts"],
provider: "v8",
reporter: ["text", "json", "html", ["text", { file: "coverage-rpc-text.txt" }]],
thresholds: {
lines: 90,
functions: 90,
branches: 75,
statements: 90,
},
},
},
})
);