Skip to content

Commit

Permalink
Add tests for custom entries with multiple values
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Bailleau committed Jun 25, 2018
1 parent dee3ab0 commit a98deca
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/basic-test.js
Expand Up @@ -61,3 +61,13 @@ assert.equal(typeof ('astring'.red), 'string');
assert.equal(typeof ('astring'.error), 'string');

assert.equal(s, 'string');

colors.setTheme({custom: ['blue', 'bold', 'underline']});
assert.equal(colors.custom(s),
'\x1b[34m' + '\x1b[1m' + '\x1b[4m' + s +
'\x1b[24m' + '\x1b[22m' + '\x1b[39m' );

colors.setTheme({custom: ['red', 'italic', 'inverse']});
assert.equal(colors.custom(s),
'\x1b[31m' + '\x1b[3m' + '\x1b[7m' + s +
'\x1b[27m' + '\x1b[23m' + '\x1b[39m' );
9 changes: 9 additions & 0 deletions tests/safe-test.js
Expand Up @@ -57,3 +57,12 @@ colors.setTheme({error: 'red'});
assert.equal(typeof (colors.red('astring')), 'string');
assert.equal(typeof (colors.error('astring')), 'string');

colors.setTheme({custom: ['blue', 'bold', 'underline']});
assert.equal(colors.custom(s),
'\x1b[4m' + '\x1b[1m' + '\x1b[34m' + s +
'\x1b[39m' + '\x1b[22m' + '\x1b[24m' );

colors.setTheme({custom: ['red', 'italic', 'inverse']});
assert.equal(colors.custom(s),
'\x1b[7m' + '\x1b[3m' + '\x1b[31m' + s +
'\x1b[39m' + '\x1b[23m' + '\x1b[27m' );

0 comments on commit a98deca

Please sign in to comment.