textui/ansi.test.ts

11 lines
384 B
TypeScript

import { AnsiTerminalDisplay } from "./ansi.ts";
import { Buffer, describe, expect, it } from "./deps.test.ts";
describe(AnsiTerminalDisplay, () => {
it("clears the screen", async () => {
const stdout = new Buffer();
const display = new AnsiTerminalDisplay(stdout);
await display.clear();
expect(stdout.bytes()).toEqual(new Uint8Array([27, 91, 50, 74]));
});
});