-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from jas/chalk
Replace cli-color with chalk
- Loading branch information
Showing
5 changed files
with
28 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
var strings = require("../index.js"); | ||
var compile = strings.getCompiler("{green:[BS]}"); | ||
var ansiTrim = require('cli-color/lib/trim'); | ||
var chalk = require('chalk'); | ||
var stripColor = chalk.stripColor; | ||
|
||
describe("Returning the compile function", function () { | ||
it("can use a prefix", function () { | ||
expect(typeof compile === "function").toBe(true); | ||
}); | ||
it("can compile with a prefix", function () { | ||
var actual = ansiTrim(compile("kittie")); | ||
var actual = stripColor(compile("kittie")); | ||
var expected = "[BS] kittie"; | ||
expect(actual).toBe(expected); | ||
}); | ||
it("can compile multiple lines with prefix (1)", function () { | ||
var actual = ansiTrim(compile(["kittie", "shane"])); | ||
var actual = stripColor(compile(["kittie", "shane"])); | ||
var expected = "[BS] kittie\n[BS] shane"; | ||
expect(actual).toBe(expected); | ||
}); | ||
it("can compile multiple lines with prefix (2)", function () { | ||
var actual = ansiTrim(compile(["{green:kittie}", "shane"])); | ||
var actual = stripColor(compile(["{green:kittie}", "shane"])); | ||
var expected = "[BS] kittie\n[BS] shane"; | ||
expect(actual).toBe(expected); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters