Luigit
repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by admin

vitest.mutation.config.ts

Raw
import { defineConfig } from "vitest/config";
import base from "./vitest.config.ts";

// Mutation runs only the deterministic, fast projects: the slow `packages`
// (relocated dist loaded through a child Pi) and process-heavy `native`
// projects are inappropriate for per-mutant execution.
const MUTATION_PROJECTS = new Set(["unit", "contract", "isolated-serial"]);

const projects = (base.test?.projects ?? []).filter(
	(project) =>
		typeof project === "object" &&
		project !== null &&
		"test" in project &&
		MUTATION_PROJECTS.has(
			(project as { test?: { name?: string } }).test?.name ?? "",
		),
);

export default defineConfig({
	...base,
	test: { ...base.test, projects },
});