textui/ansi.test.ts

12 lines
384 B
TypeScript
Raw Normal View History

2021-05-11 21:20:33 +00:00
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]));
});
});