import { defineConfig } from "vitest/config"; export default defineConfig({ test: { // strictTags (default in vitest 4.1) rejects any tag not declared here or on a // project. Declared once at the root so both projects inherit the vocabulary. tags: [ { name: "slow" }, { name: "ios" }, { name: "android" }, { name: "physical" }, { name: "physical-manual" }, ], projects: [ { test: { name: "unit", // `ui/` holds the console's own unit tests: plain functions, no browser. The browser // lane is Playwright's (`pnpm test:console`). include: ["src/**/*.test.ts", "ui/**/*.test.{ts,tsx}"], // why: the timing files measure throughput and latency of GiB transfers: they run one // at a time (`pnpm test:timing`) so another file's load cannot move a number. exclude: ["**/node_modules/**", "src/**/*.timing.test.ts"], // why: the script tests under src/ spawn node, git and a fake gh per case; under a full // parallel run the default five seconds times three of them out (lint-rules, claim, // mutate) while each passes alone in under a second. A hang still fails within 20 s. testTimeout: 20_000, }, }, { test: { name: "timing", include: ["src/**/*.timing.test.ts"], fileParallelism: false, testTimeout: 300_000, hookTimeout: 120_000, }, }, { test: { name: "e2e", include: ["e2e/**/*.test.ts"], setupFiles: ["e2e/helpers/setup.ts"], // Each flow gets its own temp SIMLOCK_HOME, so its config, state, socket and log // are its own and files can run side by side. Four workers keep a CI runner's // cores free for the daemons each flow spawns. fileParallelism: true, maxWorkers: 4, // Individual slow real-SDK flows (tagged "slow") set their own longer // per-test timeout -- a hang in the fast fake-driver lane should fail in // ~2 minutes, not stall CI for ten. testTimeout: 120_000, // Teardown is a hook: stopping the daemon and waiting its process out can take ~35s, // and a real-SDK flow's teardown then empties its iOS device set (up to 45s more). hookTimeout: 120_000, }, }, ], }, });