refactor(tui): extract standalone package (#31193)

This commit is contained in:
Dax
2026-06-07 05:24:27 +00:00
committed by GitHub
parent 7a2c49e762
commit 106f8e94d6
84 changed files with 1148 additions and 1919 deletions
+30
View File
@@ -0,0 +1,30 @@
import { expect, test } from "bun:test"
import { destroyRenderer } from "../../src/util/renderer"
test("clears the terminal title before destroying the renderer", () => {
const calls: string[] = []
destroyRenderer({
isDestroyed: false,
setTerminalTitle(title) {
calls.push(`title:${title}`)
},
destroy() {
calls.push("destroy")
},
})
expect(calls).toEqual(["title:", "destroy"])
})
test("still clears the title after renderer destruction", () => {
const calls: string[] = []
destroyRenderer({
isDestroyed: true,
setTerminalTitle(title) {
calls.push(`title:${title}`)
},
destroy() {
calls.push("destroy")
},
})
expect(calls).toEqual(["title:"])
})