Files
vue-tui/packages/runtime-tests/vite.config.ts
T
Yunfei He ee6004b8be test(runtime-tests): run the main suite concurrently by default
Enable sequence.concurrent: true in vite.config.ts so the non-PTY suite runs
concurrently like the PTY suite. Stress-verified stable (8/8 at maxForks=4);
the suite drops from ~13s to ~4-5s.

Three test patterns were incompatible with concurrency; handled per cause:

- Inline snapshots (background-color, borders): the module-level `expect`
  loses snapshot test context under concurrency. Fixed in place by using the
  context-local `expect` (async ({ expect }) => ...), so they stay concurrent.

- Process-global state (throttle/animation-scheduler use fake timers; leak
  asserts on process exit/SIGINT listener counts and live yoga nodes): a
  concurrent sibling clobbers the shared global mid-test. These genuinely
  require serial execution, so they move to *.sequential.test.* files with
  it.sequential / describe.sequential and a header explaining why.

`vp run ready` passes.
2026-05-29 16:54:13 +08:00

20 lines
793 B
TypeScript

import { defineConfig } from "vite-plus";
import vueJsx from "@vitejs/plugin-vue-jsx";
export default defineConfig({
plugins: [vueJsx()],
test: {
// chalk disables color in non-TTY envs; force it on so ANSI style bugs don't hide from tests
env: { FORCE_COLOR: "3" },
// Tests run concurrently by default. Tests that genuinely need serial
// execution (process-global fake timers) live in their own *.sequential
// files. Snapshot tests stay concurrent by using the context-local expect.
sequence: { concurrent: true },
// PTY tests run separately via vitest.pty.config.ts (they need node-pty's forks pool and a longer timeout)
exclude: ["integration/pty/**", "node_modules/**"],
},
lint: {
ignorePatterns: ["integration/pty/fixtures/**"],
},
});