-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
32 lines (29 loc) · 898 Bytes
/
Copy pathvitest.config.ts
File metadata and controls
32 lines (29 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { existsSync, readdirSync } from "node:fs";
import path from "node:path";
import { defineConfig } from "vitest/config";
import { SharedWorkerSequencer } from "./vitest.shared.js";
const workspaceRoots = [
"apps",
"packages",
"tests",
"examples/plugins",
] as const;
function discoverVitestProjects(): string[] {
return workspaceRoots
.flatMap((workspaceRoot) =>
readdirSync(path.resolve(workspaceRoot), { withFileTypes: true })
.filter((entry) => entry.isDirectory())
.map((entry) => path.join(workspaceRoot, entry.name))
.filter((projectPath) =>
existsSync(path.resolve(projectPath, "vitest.config.ts")),
),
)
.sort((a, b) => a.localeCompare(b));
}
export default defineConfig({
test: {
silent: "passed-only",
sequence: { sequencer: SharedWorkerSequencer },
projects: discoverVitestProjects(),
},
});