Download packages/tui/test/util/renderer.test.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 729 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/tui/test/util/renderer.test.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/tui/test/util/renderer.test.ts
-
curl -L -o renderer.test.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/tui/test/util/renderer.test.ts
729 Bytes
| 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:"]) | |
| }) | |