forked from juspay/neurolink
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
43 lines (37 loc) · 1.73 KB
/
Copy pathvite.config.ts
File metadata and controls
43 lines (37 loc) · 1.73 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
import { sveltekit } from "@sveltejs/kit/vite";
import { defineConfig, type UserConfig } from "vite";
export default defineConfig({
plugins: [sveltekit()],
// FIXED test configuration - prevents hanging with execAsync
test: {
include: ["test/**/*.ts"], // Include all .ts files in test/ directory
testTimeout: 30000, // 30 seconds max per test (reduce if possible)
hookTimeout: 10000, // Reduced to detect hangs faster
globals: true, // Enable describe, it, expect globally
// SIMPLE execution configuration - no complex pooling
// Switched from "forks" to "threads" for improved performance and parallelism.
// Note: Using "threads" may reduce process isolation, which can affect tests that spawn external processes.
// Ensure your tests do not rely on full process isolation, or revert to "forks" if needed.
pool: "threads", // Use threads instead of forks
poolOptions: {
threads: {
singleThread: false, // Allow some parallelism
minThreads: 1,
maxThreads: 4, // Increased parallelism for faster test execution
},
},
// Enable isolation with proper cleanup to prevent interference
isolate: true, // Ensure test isolation for reliability
maxConcurrency: 1, // Sequential execution for stability
// Don't bail early - let all tests complete
bail: 0,
// Basic reporting - no complex logging that might hang
reporters: ["verbose", "json"],
outputFile: "test-results.json",
onConsoleLog: (log: string, type: "stdout" | "stderr") => {
if (log.includes("timeout") || log.includes("hanging")) {
console.error(`🚨 Potential hanging test: ${log}`);
}
},
},
} as const satisfies UserConfig); // Properly typed configuration