openclaw/scripts/lib/vitest-runtime-selection.mts
Peter Steinberger f4bde51ed1
fix: preserve targeted test selection under Bun (#139497)
* fix(test): preserve glob selection under Bun

Use the existing Minimatch dependency with Node-compatible matching semantics so negative-extglob UI ownership does not silently discard explicitly selected files under Bun. Preserve intentional empty unrelated project behavior and cover selection, intersection, and scoped configuration.

* fix(test): keep Node glob planning dependency-free

* fix(test): isolate runtime matching from dependency-free planning
2026-09-05 23:54:25 -07:00

18 lines
695 B
TypeScript

import { matchesVitestCliSelection } from "../../test/vitest/vitest.pattern-file.ts";
import {
resolveVitestRuntimeConfigScopes,
type VitestRuntimeTestSelection,
} from "./vitest-build-prerequisites.mts";
/** Bind installed CLI matching without adding runtime dependencies to CI planning. */
export function resolveVitestRuntimeCliSelections(
config: string,
args: string[],
env: NodeJS.ProcessEnv,
): VitestRuntimeTestSelection[] {
return resolveVitestRuntimeConfigScopes(config).map(({ configs, dir }) => ({
configs,
matchesFile: (file, included, includePatterns) =>
matchesVitestCliSelection(file, included ? [file] : [], args, dir, env, includePatterns),
}));
}