1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-29 16:30:56 -05:00
denoland-deno/colors/test.ts
Vincent LE GOFF dcd01dd025 Eslint fixes (denoland/deno_std#356)
Make warnings fail
Original: 4543b563a9
2019-04-24 07:41:22 -04:00

25 lines
842 B
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-2019 the Deno authors. All rights reserved. MIT license.
import { test } from "../testing/mod.ts";
import { assertEquals } from "../testing/asserts.ts";
import { red, bgBlue, setEnabled, getEnabled } from "./mod.ts";
import "../examples/colors.ts";
test(function singleColor(): void {
assertEquals(red("Hello world"), "Hello world");
});
test(function doubleColor(): void {
assertEquals(bgBlue(red("Hello world")), "Hello world");
});
test(function replacesCloseCharacters(): void {
assertEquals(red("Hello"), "Hello");
});
test(function enablingColors(): void {
assertEquals(getEnabled(), true);
setEnabled(false);
assertEquals(bgBlue(red("Hello world")), "Hello world");
setEnabled(true);
assertEquals(red("Hello world"), "Hello world");
});