Files
AirCoding/packages/tui/test/util/renderer.test.ts
airlongdian c4f9fe109e fix: logo 右半部分从 CODING 改为 CODE
去掉难以正确渲染的 N 和 G 字母,右半部分简化为 CODE(4 字母),
与左半部分 AIR 组合为 AIR CODE。
2026-06-14 09:54:53 +08:00

31 lines
729 B
TypeScript

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:"])
})