mirror of
https://github.com/morluto/rea
synced 2026-10-25 22:08:11 -04:00
test: remove Vitest config test exports
This commit is contained in:
@@ -6,10 +6,7 @@ import { promisify } from "node:util";
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import vitestConfiguration, {
|
||||
MAX_TEST_WORKERS,
|
||||
TEST_PROJECTS,
|
||||
} from "../../vitest.config.js";
|
||||
import vitestConfiguration from "../../vitest.config.js";
|
||||
|
||||
const execute = promisify(execFile);
|
||||
const EXPECTED_PROJECTS = [
|
||||
@@ -30,29 +27,28 @@ describe("Vitest project configuration", () => {
|
||||
expect(vitestConfiguration.test?.reporters).toEqual(["default"]);
|
||||
expect(vitestConfiguration.test?.retry).toBe(0);
|
||||
const local = process.env.CI !== "true";
|
||||
expect(MAX_TEST_WORKERS).toBe(
|
||||
local ? 1 : Math.min(2, availableParallelism()),
|
||||
const maxWorkers = local ? 1 : Math.min(2, availableParallelism());
|
||||
expect(vitestConfiguration.test?.maxWorkers).toBe(maxWorkers);
|
||||
const projects = (vitestConfiguration.test?.projects ?? []).flatMap(
|
||||
(project) =>
|
||||
typeof project === "object" && project !== null && "test" in project
|
||||
? [project.test]
|
||||
: [],
|
||||
);
|
||||
expect(projects).toHaveLength(EXPECTED_PROJECTS.length);
|
||||
expect(
|
||||
TEST_PROJECTS.every(
|
||||
projects.every(
|
||||
({ fileParallelism, maxWorkers, sequence }) =>
|
||||
maxWorkers === MAX_TEST_WORKERS &&
|
||||
maxWorkers === vitestConfiguration.test?.maxWorkers &&
|
||||
(local
|
||||
? fileParallelism === false && sequence?.groupOrder !== undefined
|
||||
: true),
|
||||
),
|
||||
).toBe(true);
|
||||
expect(TEST_PROJECTS.map(({ name }) => name).sort()).toEqual(
|
||||
EXPECTED_PROJECTS,
|
||||
);
|
||||
const sharedModuleProjects = new Set([
|
||||
"domain",
|
||||
"mcp-boundary",
|
||||
"services",
|
||||
]);
|
||||
expect(projects.map(({ name }) => name).sort()).toEqual(EXPECTED_PROJECTS);
|
||||
expect(
|
||||
TEST_PROJECTS.every(({ name, isolate }) =>
|
||||
sharedModuleProjects.has(name)
|
||||
projects.every(({ name, isolate }) =>
|
||||
name === "domain" || name === "mcp-boundary" || name === "services"
|
||||
? isolate === false
|
||||
: isolate === undefined,
|
||||
),
|
||||
|
||||
+2
-4
@@ -15,11 +15,9 @@ const LOCAL_ONLY = process.env.CI !== "true";
|
||||
|
||||
// Keep local runs to one worker and one project at a time. CI shards have
|
||||
// dedicated capacity and retain the existing bounded worker budget.
|
||||
export const MAX_TEST_WORKERS = LOCAL_ONLY
|
||||
? 1
|
||||
: Math.min(2, availableParallelism());
|
||||
const MAX_TEST_WORKERS = LOCAL_ONLY ? 1 : Math.min(2, availableParallelism());
|
||||
|
||||
export const TEST_PROJECTS = [
|
||||
const TEST_PROJECTS = [
|
||||
{
|
||||
name: "domain",
|
||||
include: ["src/{contracts,domain}/**/*.test.ts"],
|
||||
|
||||
Reference in New Issue
Block a user