Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  vitest.unit.config.ts

  Sprache: JAVA
 

import { defineConfig } from "vitest/config";
import { loadPatternListFromEnv, narrowIncludePatternsForCli } from "./vitest.pattern-file.ts";
import { resolveVitestIsolation } from "./vitest.scoped-config.ts";
import {
  nonIsolatedRunnerPath,
  resolveRepoRootPath,
  sharedVitestConfig,
} from "./vitest.shared.config.ts";
import { getUnitFastTestFiles } from "./vitest.unit-fast-paths.mjs";
import {
  isBundledPluginDependentUnitTestFile,
  unitTestAdditionalExcludePatterns,
  unitTestIncludePatterns,
} from "./vitest.unit-paths.mjs";

const sharedTest = sharedVitestConfig.test ?? {};
const exclude = sharedTest.exclude ?? [];

export function loadIncludePatternsFromEnv(
  env: Record<string, string | undefined> = process.env,
): string[] | null {
  return loadPatternListFromEnv("OPENCLAW_VITEST_INCLUDE_FILE", env);
}

export function loadExtraExcludePatternsFromEnv(
  env: Record<string, string | undefined> = process.env,
): string[] {
  return loadPatternListFromEnv("OPENCLAW_VITEST_EXTRA_EXCLUDE_FILE", env) ?? [];
}

export function createUnitVitestConfigWithOptions(
  env: Record<string, string | undefined> = process.env,
  options: {
    includePatterns?: string[];
    extraExcludePatterns?: string[];
    name?: string;
    argv?: string[];
  } = {},
) {
  const isolate = resolveVitestIsolation(env);
  const unitFastTestFiles = getUnitFastTestFiles();
  const defaultIncludePatterns = options.includePatterns ?? unitTestIncludePatterns;
  const cliIncludePatterns = narrowIncludePatternsForCli(defaultIncludePatterns, options.argv);
  const protectedIncludeFiles = new Set(
    defaultIncludePatterns.filter((pattern) => isBundledPluginDependentUnitTestFile(pattern)),
  );
  const baseExcludePatterns = unitTestAdditionalExcludePatterns.filter((pattern) => {
    if (protectedIncludeFiles.size === 0) {
      return true;
    }
    return ![...protectedIncludeFiles].some((file) => pattern === file || pattern.endsWith("/**"));
  });
  const extraExcludePatterns = options.extraExcludePatterns ?? [];
  return defineConfig({
    ...sharedVitestConfig,
    test: {
      ...sharedTest,
      name: options.name ?? "unit",
      isolate,
      ...(isolate ? { runner: undefined } : { runner: nonIsolatedRunnerPath }),
      setupFiles: [
        ...new Set(
          [...(sharedTest.setupFiles ?? []), "test/setup-openclaw-runtime.ts"].map(
            resolveRepoRootPath,
          ),
        ),
      ],
      include: loadIncludePatternsFromEnv(env) ?? cliIncludePatterns ?? defaultIncludePatterns,
      exclude: [
        ...new Set([
          ...exclude,
          ...baseExcludePatterns,
          ...unitFastTestFiles,
          ...extraExcludePatterns,
          ...loadExtraExcludePatternsFromEnv(env),
        ]),
      ],
      coverage: {
        ...sharedTest.coverage,
        exclude: [
          ...new Set([
            ...(sharedTest.coverage?.exclude ?? []),
            ...baseExcludePatterns,
            ...extraExcludePatterns,
          ]),
        ],
      },
      ...(cliIncludePatterns !== null ? { passWithNoTests: true } : {}),
    },
  });
}

export function createUnitVitestConfig(env: Record<string, string | undefined> = process.env) {
  return createUnitVitestConfigWithOptions(env);
}

export default createUnitVitestConfigWithOptions();

Messung V0.5 in Prozent
C=100 H=100 G=100

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet am  2026-06-10) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik