1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-01 09:24:20 -04:00
denoland-deno/std/fmt/colors_test.ts
Bartek Iwańczuk 8feb30e325
BREAKING: remove overload of Deno.test() (#4951)
This commit removes overload of Deno.test() that accepted named
function.
2020-04-28 12:33:09 +02:00

120 lines
3.3 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import { assertEquals } from "../testing/asserts.ts";
import * as c from "./colors.ts";
import "../examples/colors.ts";
Deno.test("singleColor", function (): void {
assertEquals(c.red("foo bar"), "foo bar");
});
Deno.test("doubleColor", function (): void {
assertEquals(c.bgBlue(c.red("foo bar")), "foo bar");
});
Deno.test("replacesCloseCharacters", function (): void {
assertEquals(c.red("Hello"), "Hello");
});
Deno.test("enablingColors", function (): void {
assertEquals(c.getColorEnabled(), true);
c.setColorEnabled(false);
assertEquals(c.bgBlue(c.red("foo bar")), "foo bar");
c.setColorEnabled(true);
assertEquals(c.red("foo bar"), "foo bar");
});
Deno.test("testBold", function (): void {
assertEquals(c.bold("foo bar"), "foo bar");
});
Deno.test("testDim", function (): void {
assertEquals(c.dim("foo bar"), "foo bar");
});
Deno.test("testItalic", function (): void {
assertEquals(c.italic("foo bar"), "foo bar");
});
Deno.test("testUnderline", function (): void {
assertEquals(c.underline("foo bar"), "foo bar");
});
Deno.test("testInverse", function (): void {
assertEquals(c.inverse("foo bar"), "foo bar");
});
Deno.test("testHidden", function (): void {
assertEquals(c.hidden("foo bar"), "foo bar");
});
Deno.test("testStrikethrough", function (): void {
assertEquals(c.strikethrough("foo bar"), "foo bar");
});
Deno.test("testBlack", function (): void {
assertEquals(c.black("foo bar"), "foo bar");
});
Deno.test("testRed", function (): void {
assertEquals(c.red("foo bar"), "foo bar");
});
Deno.test("testGreen", function (): void {
assertEquals(c.green("foo bar"), "foo bar");
});
Deno.test("testYellow", function (): void {
assertEquals(c.yellow("foo bar"), "foo bar");
});
Deno.test("testBlue", function (): void {
assertEquals(c.blue("foo bar"), "foo bar");
});
Deno.test("testMagenta", function (): void {
assertEquals(c.magenta("foo bar"), "foo bar");
});
Deno.test("testCyan", function (): void {
assertEquals(c.cyan("foo bar"), "foo bar");
});
Deno.test("testWhite", function (): void {
assertEquals(c.white("foo bar"), "foo bar");
});
Deno.test("testGray", function (): void {
assertEquals(c.gray("foo bar"), "foo bar");
});
Deno.test("testBgBlack", function (): void {
assertEquals(c.bgBlack("foo bar"), "foo bar");
});
Deno.test("testBgRed", function (): void {
assertEquals(c.bgRed("foo bar"), "foo bar");
});
Deno.test("testBgGreen", function (): void {
assertEquals(c.bgGreen("foo bar"), "foo bar");
});
Deno.test("testBgYellow", function (): void {
assertEquals(c.bgYellow("foo bar"), "foo bar");
});
Deno.test("testBgBlue", function (): void {
assertEquals(c.bgBlue("foo bar"), "foo bar");
});
Deno.test("testBgMagenta", function (): void {
assertEquals(c.bgMagenta("foo bar"), "foo bar");
});
Deno.test("testBgCyan", function (): void {
assertEquals(c.bgCyan("foo bar"), "foo bar");
});
Deno.test("testBgWhite", function (): void {
assertEquals(c.bgWhite("foo bar"), "foo bar");
});