import path from "node:path" ;
import {
bundledPluginDependentUnitTestFiles,
unitTestAdditionalExcludePatterns,
} from "./vitest.unit-paths.mjs" ;
import { createUnitVitestConfigWithOptions } from "./vitest.unit.config.ts" ;
function normalizeGlobCandidate(value: string): string {
return value.split(path.sep).join("/" );
}
function excludePatternCouldMatchFile(pattern: string, file: string): boolean {
const normalizedPattern = normalizeGlobCandidate(pattern);
const normalizedFile = normalizeGlobCandidate(file);
if (normalizedPattern === normalizedFile) {
return true ;
}
if (normalizedPattern.endsWith("/**")) {
const prefix = normalizedPattern.slice(0 , -3 );
return normalizedFile === prefix || normalizedFile.startsWith(`${prefix}/`);
}
return path.matchesGlob(normalizedFile, normalizedPattern);
}
const bundledUnitExcludePatterns = unitTestAdditionalExcludePatterns.filter(
(pattern) =>
!bundledPluginDependentUnitTestFiles.some((file) =>
excludePatternCouldMatchFile(pattern, file),
),
);
export default createUnitVitestConfigWithOptions(process.env, {
includePatterns: bundledPluginDependentUnitTestFiles,
extraExcludePatterns: bundledUnitExcludePatterns,
name: "bundled" ,
});
Messung V0.5 in Prozent C=96 H=92 G=93
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-10)
¤
*© Formatika GbR, Deutschland