1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-29 02:29:06 -05:00
denoland-deno/colors/test.ts
2019-02-07 11:45:47 -05:00

22 lines
682 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 { assert, test } from "../testing/mod.ts";
import { red, bgBlue, setEnabled, getEnabled } from "./mod.ts";
import "./example.ts";
test(function singleColor() {
assert.equal(red("Hello world"), "Hello world");
});
test(function doubleColor() {
assert.equal(bgBlue(red("Hello world")), "Hello world");
});
test(function replacesCloseCharacters() {
assert.equal(red("Hello"), "Hello");
});
test(function enablingColors() {
assert.equal(getEnabled(), true);
setEnabled(false);
assert.equal(bgBlue(red("Hello world")), "Hello world");
});