71e7d7e2f0
render() never set `interactive`, so the runtime derived it as `!isInCi && Boolean(stdout.isTTY)`. `is-in-ci` is evaluated once at module import, so consumers running @vue-tui/testing in CI silently got a non-interactive app: `terminal.resize()` emitted but never re-laid-out (the resize handler is registered only when interactive), and the lifetime raw-mode hold never engaged (`terminal.rawMode.current` stayed false) — breaking both APIs the README advertises. Pin `interactive: options.interactive ?? true` in the mount options so the harness is deterministic and independent of ambient CI/TTY detection, and expose `interactive?: boolean` on RenderOptions so non-interactive behavior stays testable. Runtime behavior is unchanged. Add a subprocess test (runtime-tests, sequential — depends on the process-global CI env baked into the child at import time) that spawns the BUILT dist with CI=true vs CI=false, renders a bordered Box that fills the columns, resizes 40→12, and asserts the re-layout happened and raw mode is held. It fails on origin/main (resize ignored under CI=true) and passes with the fix. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
23 lines
1.1 KiB
TypeScript
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/**", "integration/subprocess-fixtures/*.mjs"],
|
|
},
|
|
});
|