a7f7d9957d
21 test files covering components, composables, focus, lifecycle, and scheduler through the public render() API. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
26 lines
879 B
TypeScript
26 lines
879 B
TypeScript
import { defineComponent } from "vue";
|
|
import { expect, test } from "vite-plus/test";
|
|
import { render } from "@vue-tui/testing";
|
|
import { Text } from "@vue-tui/runtime";
|
|
|
|
test("exitOnCtrlC registers a SIGINT handler that unmount removes", async () => {
|
|
const before = process.listenerCount("SIGINT");
|
|
|
|
const App = defineComponent(() => () => <Text>x</Text>);
|
|
const { unmount } = await render(App, { exitOnCtrlC: true });
|
|
|
|
expect(process.listenerCount("SIGINT")).toBe(before + 1);
|
|
unmount();
|
|
expect(process.listenerCount("SIGINT")).toBe(before);
|
|
});
|
|
|
|
test("exitOnCtrlC=false registers no SIGINT handler", async () => {
|
|
const before = process.listenerCount("SIGINT");
|
|
|
|
const App = defineComponent(() => () => <Text>x</Text>);
|
|
const { unmount } = await render(App, { exitOnCtrlC: false });
|
|
|
|
expect(process.listenerCount("SIGINT")).toBe(before);
|
|
unmount();
|
|
});
|