Files
nexu-io__open-design/apps/web/vitest.config.ts
Marc Chan 66004e0cd7 test: raise CI flake budgets for waitFor and wall clocks (#6415)
* test: raise CI flake budgets for waitFor and wall clocks

Web jsdom waitFor was dying on the 1s default under runner contention.
Daemon deploy wall-clock asserts, logo body-timeout margin, and vela
fixed sleeps had zero/thin slack on slow CI CPUs.

* test: scope flake budgets and restore ReDoS guard

Keep the doctype prolog linear-time assert at 500ms so a reintroduced
lazy-body regex (~5s) cannot pass. Drop the global waitFor 5s raise and
apply a 2s budget only to the App.connectors privacy-choice waits that
flaked at 1015–1093ms under CI contention.

Generated-By: looper 0.11.8 (runner=fixer, agent=grok-build)

* test: restore CSS budget and abort-aware logo body mock

Generated-By: looper 0.11.8 (runner=fixer, agent=grok-build)

* test: wait for Vela login close before no-fallback assert

loginInFlight can go idle between child exit and close after cancel,
so the canceled late-fallback test now waits on supervisor settlement
(close/error terminal + pending fallback) instead of status idle.

Generated-By: looper 0.11.8 (runner=fixer, agent=grok-build)

* test: narrow AbortSignal for logo body mock typecheck

Preflight failed because init.signal was still possibly null after the
optional guard. Capture a local signal so tsc can prove it is defined.

Generated-By: looper 0.11.8 (runner=fixer, agent=grok-build)

* test: use global Testing Library asyncUtilTimeout 5s

Raise waitFor/findBy failure budget in the shared jsdom setup instead of
scoping a 2s override to App.connectors privacy cases. Drop no-op deploy
comment churn that did not change the ReDoS wall-clock guards.

* test: scope waitFor budget to privacy waits only

Drop suite-wide Testing Library asyncUtilTimeout 5s so unrelated
waitFor/findBy failures still surface assertion errors quickly.
Restore a 2s timeout only on App.connectors first-run privacy waits
that flaked under CI contention.

Generated-By: looper 0.11.8 (runner=fixer, agent=grok-build)

* Revert "test: scope waitFor budget to privacy waits only"

This reverts commit 7b41997565.

* test: set asyncUtilTimeout to 10s to avoid 5s timer spies

Product code and tests hardcode 5000ms (GitHub connector status,
brand poll). Spies that fire timeout === 5000 immediately also
hijacked Testing Library's waitFor overall timer when the global
budget was 5s. Keep the suite-wide failure budget; pick 10s.

* test: tighten async timeout and completion assertions
2026-08-06 07:57:25 +00:00

20 lines
661 B
TypeScript

import { resolve } from 'node:path';
import { defineConfig } from 'vitest/config';
export default defineConfig({
resolve: {
alias: {
'@excalidraw/excalidraw': resolve(__dirname, 'tests/helpers/excalidraw-mock.tsx'),
'motion/react': resolve(__dirname, 'tests/helpers/motion-mock.tsx'),
},
},
test: {
environment: 'node',
include: ['tests/**/*.test.{ts,tsx}'],
// Keep this above the shared Testing Library asyncUtilTimeout so failed
// waits retain Testing Library's assertion/DOM diagnostics.
testTimeout: 5_000,
setupFiles: ['./tests/setup/jsdom-lexical.ts', './tests/setup/coalesced-get-reset.ts'],
},
});