- Stop injecting a hardcoded Browser Verification option in WorkflowResultsTab and rely only on fetched workflow step definitions - Normalize workflow step checkbox test IDs to be id-based for all options, including template-backed Browser Verification steps - Extend WorkflowResultsTab coverage to assert Browser Verification renders exactly once when provided by API data - Increase dashboard Vitest timeout defaults and update the slow route test timeout to reduce flaky failures under concurrent workspace runs
49 lines
1.9 KiB
TypeScript
49 lines
1.9 KiB
TypeScript
import { defineConfig } from "vitest/config";
|
|
import react from "@vitejs/plugin-react";
|
|
import { resolve } from "node:path";
|
|
import { cpus } from "node:os";
|
|
|
|
const defaultMaxWorkers = Math.max(1, cpus().length - 1);
|
|
const requestedMaxWorkers = Number.parseInt(process.env.VITEST_MAX_WORKERS ?? String(defaultMaxWorkers), 10);
|
|
const maxWorkers = Math.max(1, Number.isFinite(requestedMaxWorkers) ? requestedMaxWorkers : defaultMaxWorkers);
|
|
process.env.VITEST_MAX_WORKERS = String(maxWorkers);
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
"@fusion/core": resolve(__dirname, "../core/src/index.ts"),
|
|
"@fusion/engine": resolve(__dirname, "../engine/src/index.ts"),
|
|
"@fusion/test-utils": resolve(__dirname, "../core/src/__test-utils__/workspace.ts"),
|
|
},
|
|
},
|
|
test: {
|
|
environment: "jsdom",
|
|
// Process CSS imports so jsdom-based tests that assert on getComputedStyle
|
|
// see the actual rules from co-located component CSS files.
|
|
css: { include: [/.+/] },
|
|
globals: true,
|
|
include: ["app/**/*.test.{ts,tsx}", "src/**/*.test.{ts,tsx}"],
|
|
setupFiles: [
|
|
resolve(__dirname, "../core/src/__test-utils__/vitest-setup.ts"),
|
|
"./vitest.setup.ts",
|
|
],
|
|
globalSetup: [resolve(__dirname, "../core/src/__test-utils__/vitest-teardown.ts")],
|
|
maxWorkers,
|
|
poolOptions: { threads: { minThreads: 1, maxThreads: maxWorkers }, forks: { minForks: 1, maxForks: maxWorkers } },
|
|
fileParallelism: true,
|
|
isolate: true,
|
|
// Dashboard route and integration-heavy suites can exceed the Vitest
|
|
// 5s default under workspace-concurrent runs.
|
|
testTimeout: 15_000,
|
|
hookTimeout: 15_000,
|
|
coverage: {
|
|
enabled: false,
|
|
reporter: ["text", "html", "json"],
|
|
reportsDirectory: "./coverage",
|
|
include: ["app/**/*.{ts,tsx}", "src/**/*.{ts,tsx}"],
|
|
exclude: ["**/*.test.{ts,tsx}", "**/*.d.ts", "dist/**"],
|
|
},
|
|
},
|
|
});
|