summaryrefslogtreecommitdiff
path: root/colors/test.ts
blob: bdce355234b58ca80a6ac5e3341580c03f79e44b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// 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");
});