import path from "path"; import { defineConfig } from "vitest/config"; export default defineConfig({ resolve: { alias: { "@": path.resolve(import.meta.dirname, "./src"), }, }, test: { watch: false, passWithNoTests: true, environment: "node", include: ["./src/tests/**/*.test.ts"], globalSetup: ["./src/tests/utils/setup.ts"], testTimeout: 60_000, // Setup hooks make network calls; the default timeout is too tight. hookTimeout: 60_000, // Tests are network-bound, so parallelize on two axes: run several files at // once (maxWorkers) and run the independent tests within each file at once // (sequence.concurrent). maxConcurrency is set above the largest file's test // count so every file fans out fully. Test data is timestamped; rare // same-millisecond collisions are accepted. maxWorkers: 16, maxConcurrency: 10, sequence: { concurrent: true }, // Every test now builds its own data on freshly-created items, so there is // no shared-row contention. What remains is transient "[Network] fetch // failed" against the live workspace under heavy concurrency; a couple of // retries absorb those blips (same rationale as the e2e Playwright retries). retry: 2, }, });