added test for crlf
This commit is contained in:
parent
cbc9f160e8
commit
5f0835a0aa
1 changed files with 4 additions and 0 deletions
|
|
@ -82,6 +82,10 @@ test('line breaks should open and close colors', t => {
|
||||||
t.is(chalk.grey('hello\nworld'), '\u001B[90mhello\u001B[39m\n\u001B[90mworld\u001B[39m');
|
t.is(chalk.grey('hello\nworld'), '\u001B[90mhello\u001B[39m\n\u001B[90mworld\u001B[39m');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('line breaks should open and close colors with CRLF', t => {
|
||||||
|
t.is(chalk.grey('hello\r\nworld'), '\u001B[90mhello\u001B[39m\r\n\u001B[90mworld\u001B[39m');
|
||||||
|
});
|
||||||
|
|
||||||
test('properly convert RGB to 16 colors on basic color terminals', t => {
|
test('properly convert RGB to 16 colors on basic color terminals', t => {
|
||||||
t.is(new chalk.Instance({level: 1}).hex('#FF0000')('hello'), '\u001B[91mhello\u001B[39m');
|
t.is(new chalk.Instance({level: 1}).hex('#FF0000')('hello'), '\u001B[91mhello\u001B[39m');
|
||||||
t.is(new chalk.Instance({level: 1}).bgHex('#FF0000')('hello'), '\u001B[101mhello\u001B[49m');
|
t.is(new chalk.Instance({level: 1}).bgHex('#FF0000')('hello'), '\u001B[101mhello\u001B[49m');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue