mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 16:01:01 +00:00
test: fix unit coverage scope
This commit is contained in:
@@ -254,7 +254,6 @@ export const sharedVitestConfig = {
|
||||
branches: 55,
|
||||
statements: 70,
|
||||
},
|
||||
include: ["./src/**/*.ts"],
|
||||
exclude: [
|
||||
`${BUNDLED_PLUGIN_ROOT_DIR}/**`,
|
||||
"apps/**",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { defineProject } from "vitest/config";
|
||||
import { defineConfig } from "vitest/config";
|
||||
import { loadPatternListFromEnv, narrowIncludePatternsForCli } from "./vitest.pattern-file.ts";
|
||||
import { resolveVitestIsolation } from "./vitest.scoped-config.ts";
|
||||
import {
|
||||
@@ -50,7 +50,8 @@ export function createUnitVitestConfigWithOptions(
|
||||
}
|
||||
return ![...protectedIncludeFiles].some((file) => pattern === file || pattern.endsWith("/**"));
|
||||
});
|
||||
return defineProject({
|
||||
const extraExcludePatterns = options.extraExcludePatterns ?? [];
|
||||
return defineConfig({
|
||||
...sharedVitestConfig,
|
||||
test: {
|
||||
...sharedTest,
|
||||
@@ -70,10 +71,20 @@ export function createUnitVitestConfigWithOptions(
|
||||
...exclude,
|
||||
...baseExcludePatterns,
|
||||
...unitFastTestFiles,
|
||||
...(options.extraExcludePatterns ?? []),
|
||||
...extraExcludePatterns,
|
||||
...loadExtraExcludePatternsFromEnv(env),
|
||||
]),
|
||||
],
|
||||
coverage: {
|
||||
...sharedTest.coverage,
|
||||
exclude: [
|
||||
...new Set([
|
||||
...(sharedTest.coverage?.exclude ?? []),
|
||||
...baseExcludePatterns,
|
||||
...extraExcludePatterns,
|
||||
]),
|
||||
],
|
||||
},
|
||||
...(cliIncludePatterns !== null ? { passWithNoTests: true } : {}),
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user