mirror of
https://github.com/flynx/colors.js.git
synced 2025-10-29 11:00:11 +00:00
used older syntax for tests for old node versions
This commit is contained in:
parent
dfe6290c88
commit
118cb0a9ec
@ -43,14 +43,12 @@ aE(s, 'yellow', 33);
|
|||||||
|
|
||||||
assert.equal(s, 'string');
|
assert.equal(s, 'string');
|
||||||
|
|
||||||
var testStringWithNewLines = s + `
|
var testStringWithNewLines = s + '\n' + s;
|
||||||
` + s;
|
|
||||||
|
|
||||||
// single style
|
// single style
|
||||||
assert.equal(testStringWithNewLines.red, '\x1b[31m' + s + '\n' + s + '\x1b[39m');
|
assert.equal(testStringWithNewLines.red, '\x1b[31m' + s + '\n' + s + '\x1b[39m');
|
||||||
|
|
||||||
var testStringWithNewLinesStyled = s.underline + `
|
var testStringWithNewLinesStyled = s.underline + '\n' + s.bold;
|
||||||
` + s.bold;
|
|
||||||
|
|
||||||
// nested styles
|
// nested styles
|
||||||
assert.equal(testStringWithNewLinesStyled.red, '\x1b[31m' + '\x1b[4m' + s + '\x1b[24m' + '\n' + '\x1b[1m' + s + '\x1b[22m' + '\x1b[39m');
|
assert.equal(testStringWithNewLinesStyled.red, '\x1b[31m' + '\x1b[4m' + s + '\x1b[24m' + '\n' + '\x1b[1m' + s + '\x1b[22m' + '\x1b[39m');
|
||||||
|
|||||||
@ -40,14 +40,12 @@ aE(s, 'yellow', 33);
|
|||||||
|
|
||||||
assert.equal(s, 'string');
|
assert.equal(s, 'string');
|
||||||
|
|
||||||
var testStringWithNewLines = s + `
|
var testStringWithNewLines = s + '\n' + s;
|
||||||
` + s;
|
|
||||||
|
|
||||||
// single style
|
// single style
|
||||||
assert.equal(colors.red(testStringWithNewLines), '\x1b[31m' + s + '\x1b[39m' + '\n' + '\x1b[31m' + s + '\x1b[39m');
|
assert.equal(colors.red(testStringWithNewLines), '\x1b[31m' + s + '\x1b[39m' + '\n' + '\x1b[31m' + s + '\x1b[39m');
|
||||||
|
|
||||||
var testStringWithNewLinesStyled = colors.underline(s) + `
|
var testStringWithNewLinesStyled = colors.underline(s) + '\n' + colors.bold(s);
|
||||||
` + colors.bold(s);
|
|
||||||
|
|
||||||
// nested styles
|
// nested styles
|
||||||
assert.equal(colors.red(testStringWithNewLinesStyled), '\x1b[31m' + '\x1b[4m' + s + '\x1b[24m' + '\x1b[39m' + '\n' + '\x1b[31m' + '\x1b[1m' + s + '\x1b[22m' + '\x1b[39m');
|
assert.equal(colors.red(testStringWithNewLinesStyled), '\x1b[31m' + '\x1b[4m' + s + '\x1b[24m' + '\x1b[39m' + '\n' + '\x1b[31m' + '\x1b[1m' + s + '\x1b[22m' + '\x1b[39m');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user