Files
vue-tui/packages/runtime-tests/vite.config.ts
T
Yunfei He 1e9d6d0b82 fix(ci): force CI=false in vitest env so interactive render tests pass
Fifth CI run failed on ~15 resize/throttle/flush tests that pass locally. Root
cause: the GitHub runner sets CI=true, and vue-tui computes
`interactive = !isInCi && isTTY`. With CI=true, interactive is false, so the
resize listener, cursor control, and ANSI erases are never wired up — exactly
the behavior those tests assert. Locally CI is unset, so they passed (the
local-vs-CI trap, reproducible with `CI=true vp test run`).

Set env CI:"false" in both vitest configs. The PTY child helpers already force
CI=false per-spawn for this reason; the in-process suite (and the testing
harness's render()) needs the same. Verified: `CI=true vp run ci` on a fresh
checkout (no dist) now exits 0 with all 756 + 110 tests passing.
2026-05-29 16:54:13 +08:00

23 lines
1.1 KiB
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.
// CI:"false" because the runner sets CI=true, which flips vue-tui's interactive
// detection (interactive = !isInCi && isTTY) off — disabling the resize listener,
// cursor, and ANSI erases that these render tests exercise. The PTY child helpers
// already force CI=false for the same reason; do it for the in-process suite too.
env: { FORCE_COLOR: "3", CI: "false" },
// Files parallelize, but tests within a file run serially: many assert
// timing-sensitive render/commit/flush counts that destabilize under
// in-file concurrency on a constrained (4-core) CI runner.
// 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/**"],
},
});