1106be867b
Wrap user root component in an InternalErrorBoundary that catches all descendant errors (setup, render, lifecycle) via onErrorCaptured and routes them through exit(error). This prevents yoga WASM state corruption that occurred when errors propagated uncaught during Vue's render phase. - Add ErrorOverview component for rendering error frames - Replace try-catch around mount with onErrorCaptured boundary - Update testing render() to detect early exit errors - Convert 3 todo tests to active tests (nested setup, unhandledRejection, post-mount) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vue-tui/testing
Test harness for @vue-tui/runtime.
Install
pnpm add -D @vue-tui/testing vue
Quickstart
import { defineComponent, h } from "vue";
import { test, expect } from "vitest";
import { render, flush } from "@vue-tui/testing";
import { Text } from "@vue-tui/runtime";
test("renders hello", async () => {
const App = defineComponent({ render: () => h(Text, null, "hello") });
const r = render(App);
await flush();
expect(r.lastFrame()).toContain("hello");
r.unmount();
});
API
render(app, { columns?, rows? })— mount in a fake-TTY environment, collect frames.flush()— await Vue's post-flush queue + Node's immediate queue.result.lastFrame()/result.frames— frame snapshots.result.stdin.write(data)— inject input that reachesuseInputhandlers.result.app— the underlyingTuiApp(use.waitUntilExit()if needed).result.unmount()/result.waitUntilExit()— convenience pass-throughs.