-
-
Notifications
You must be signed in to change notification settings - Fork 315
Expand file tree
/
Copy pathvitest.mutation.config.ts
More file actions
31 lines (27 loc) · 994 Bytes
/
Copy pathvitest.mutation.config.ts
File metadata and controls
31 lines (27 loc) · 994 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
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vitest/config';
import { readTestScope, threadHostileTestFiles } from './scripts/mutation/test-scope.ts';
import { workspaceSourceAliases } from './scripts/mutation/workspace-aliases.ts';
import { MUTATION_EXCLUDED_TESTS, SETUP_FILES } from './vitest.config.ts';
const repoRoot = path.dirname(fileURLToPath(import.meta.url));
const inStrykerSandbox = repoRoot.includes(path.join('.tmp', 'stryker'));
const workspaceAliases = workspaceSourceAliases(
repoRoot,
inStrykerSandbox ? 'disk-manifests' : 'tracked-manifests',
);
const scope = readTestScope();
export default defineConfig({
resolve: {
alias: workspaceAliases,
},
test: {
include: scope ?? ['src/**/*.test.ts', 'packages/*/src/**/*.test.ts'],
exclude: [
...MUTATION_EXCLUDED_TESTS,
...threadHostileTestFiles(repoRoot),
'**/node_modules/**',
],
setupFiles: [...SETUP_FILES],
},
});