-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.properties.mts
More file actions
62 lines (56 loc) · 1.82 KB
/
vitest.config.properties.mts
File metadata and controls
62 lines (56 loc) · 1.82 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { defineConfig, mergeConfig } from "vitest/config";
import { commonConfig } from "./vitest.config.common.mjs";
/**
* Vitest configuration for property-based testing
*
* Property-based tests verify mathematical invariants and behavioral properties
* using randomized inputs generated by fast-check.
*
* Extends common config with:
* - Coverage disabled (focus on invariants, not coverage)
* - Extended timeout (30s for multiple iterations)
* - Reduced workers (2 for stability)
*
* @see https://vitest.dev/config/
* @see https://fast-check.dev/
*/
export default mergeConfig(
commonConfig,
defineConfig({
test: {
/**
* Coverage configuration - disabled for property tests
* Property tests focus on invariants, not coverage
*/
coverage: {
enabled: false,
},
/**
* Reporter configuration
*/
reporters: ["default"],
/**
* Test filtering - only property-based tests
*/
include: ["tests/property/**/*.properties.{ts,tsx}"],
exclude: ["node_modules", "dist", ".idea", ".git", ".cache"],
/**
* Timeout configuration
* Property-based tests run multiple iterations (50-1000+ runs per test)
* and need more time than standard example-based tests
*/
testTimeout: 30000, // 30 seconds per test
hookTimeout: 10000, // 10 seconds for hooks
teardownTimeout: 10000, // 10 seconds for cleanup
/**
* Worker configuration (Vitest 4+)
* Limit parallelism to prevent "Timeout calling onTaskUpdate" errors
* during long-running property-based tests
*/
maxWorkers: 2, // Reduced for stability
execArgv: [], // Lower priority for worker threads
// Use threads pool for better performance with async tests
pool: "threads",
},
}),
);