13 lines
452 B
TypeScript
13 lines
452 B
TypeScript
import { describe, expect, test } from "bun:test"
|
|
import { presentRows } from "../src/index.ts"
|
|
|
|
describe("presentRows", () => {
|
|
test("writes the spans", () => {
|
|
const chunks: string[] = []
|
|
presentRows((chunk) => chunks.push(chunk), [[{ text: "neuron", fg: [255, 225, 74], bg: [10, 10, 10] }]])
|
|
const out = chunks.join("")
|
|
expect(out.includes("neuron")).toBe(true)
|
|
expect(out.includes("\x1b[38;2;255;225;74m")).toBe(true)
|
|
})
|
|
})
|