hermes-agent/apps/desktop/vitest.config.ts
ethernet d57947b493
fix(desktop): bump skills test timeout to fix cold-start flake (#68235)
Test 1 in skills/index.test.tsx pays the full cold-start cost (jsdom env
init + module transform + the @/hermes/@/store/profile import graph),
which pushed past vitest's 5000ms default under load — caught at 8871ms
on one run, 6.6s pure test time on another. Tests 2-4 are ~30-130ms
each because all that setup is already cached, so only test 1 was at
risk of timing out.

Bump the describe-level timeout to 15s. Verified with 10 consecutive
runs, 4 of which took 5.5-6.6s of test time and would have hard-failed
under the old 5s default.
2026-07-20 21:27:34 +00:00

31 lines
857 B
TypeScript

import type { TestProjectConfiguration } from 'vitest/config';
import { defineConfig } from 'vitest/config'
const reactUi: TestProjectConfiguration = {
extends: './vite.config.ts',
test: {
name: 'ui',
environment: 'jsdom',
setupFiles: ['./vitest.setup.ts'],
include: ['src/**/*.test.{ts,tsx}'],
globals: true,
// The first test in each file pays jsdom env init + full module transform,
// which can exceed vitest's 5000ms default under CI/load. 15s gives the
// cold start headroom without masking genuinely hung tests.
testTimeout: 15_000
}
}
const electronNative: TestProjectConfiguration = {
test: {
name: 'electron',
environment: 'node',
include: ['electron/**/*.test.ts', 'scripts/**.test.{ts,mjs}']
}
}
export default defineConfig({
test: {
projects: [reactUi, electronNative]
}
})