[READ-ONLY] Mirror of https://github.com/bombshell-dev/tty. Platform independent 2D layout engine for terminal applications based on Clay
5

Configure Feed

Select the types of activity you want to include in your feed.

🔥tighten up the test

Just testing text attributes, shouldn't need an enclosing box.

Charles Lowell (Jun 5, 2026, 9:28 PM +0200) 6e380184 d9f71e20

+6 -13
+6 -13
test/default-foreground.test.ts
··· 1 - import { describe, expect, it } from "./suite.ts"; 1 + import { text } from "../ops.ts"; 2 2 import { createTerm } from "../term.ts"; 3 - import { close, grow, open, text } from "../ops.ts"; 3 + import { describe, expect, it } from "./suite.ts"; 4 4 5 5 const decode = (b: Uint8Array) => new TextDecoder().decode(b); 6 6 7 7 describe("true default foreground", () => { 8 - it("uncolored text emits no concrete foreground", async () => { 8 + it("emits uncolored text with no concrete foreground", async () => { 9 9 let term = await createTerm({ width: 12, height: 1 }); 10 - let ansi = decode( 11 - term.render([ 12 - open("root", { layout: { width: grow(), height: grow() } }), 13 - text("hi"), 14 - close(), 15 - ]).output, 16 - ); 10 + let ansi = decode(term.render([text("hi")]).output); 17 11 18 - let before = ansi.slice(0, ansi.indexOf("h")); 19 - // pins: color-less text must leave the terminal default fg, not force white 20 - expect(before).not.toContain("\x1b[38;2;255;255;255"); 12 + expect(ansi).toContain("hi"); 13 + expect(ansi).not.toContain("\x1b[38;2;255;255;255"); 21 14 }); 22 15 });